�
=��g�9 � � � d dl Z d dlZd dlZd dlmZmZmZ d dlmZ d dl m
Z
d dlmZ d dl
mZmZmZmZ d dlmZ d dlmZmZmZ d d lmZmZ d d
lmZ d dlmZ ej dk r d dl Z n# e!$ r esd dl"Z Y nw xY wd dl"Z d d
l#m$Z$ d dl%m&Z& d dl'm(Z( d dl)m*Z* erd dl+Z+edee
e,f de-e,ef fd�� � Z.ede
de
fd�� � Z/e d=dee, dee, de0e
e,f fd�� � Z1 d=de0e,df dee, dee, fd�Z2 ed�� � de,de-e,ef fd�� � Z3de-e,ef dee4e& fd �Z5d!e,dee4e& fd"�Z6d!e,dee4e& fd#�Z7d$edefd%�Z8ede
fd&�� � Z9ed'e
defd(�� � Z: d=de
d'e
d)ee* de;fd*�Z<de
d'e
de
fd+�Z=d,e,d'e
d-e-e
ef de;fd.�Z>d/e,d0eee, de;fd1�Z?d2ee
d'e
d3ee, d4ee, d5eee, d6eee, d)e*d-ee-e
ef d7e;d8e;dee
fd9�Z@d:e jA dee jA d;f fd<�ZBdS )>� N)�Iterable�Iterator�Sequence)� lru_cache)�Path)�Pattern)�
TYPE_CHECKING�Any�Optional�Union)�
mypyc_attr)�InvalidSpecifier� Specifier�SpecifierSet)�InvalidVersion�Version)�PathSpec)�GitWildMatchPatternError)� � )�"jupyter_dependencies_are_installed)�
TargetVersion)�err)�Report�path�returnc �~ � t | d� � 5 }t j |� � cd d d � � S # 1 swxY w Y d S )N�rb)�open�tomllib�load)r �fs �[/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/black/files.py�
_load_tomlr$ # s~ � �
�d�D� � � �Q��|�A���� � � � � � � � � � � ���� � � � � � s �2�6�6c �* � | � � � S �N)�resolve�r s r# �_cached_resolver) ) s � ��<�<�>�>�� �srcs�stdin_filenamec �D �� ��t �fd�| D � � � � } | s.t t t j � � � � � � g} d� | D � � }d� |D � � }t t
j d� |D � � � d� �� � }|g|j �R D ]�}|dz � � � r|d fc S |d
z �
� � r|dfc S |dz � � � r0t |dz � � }d
|�
di � � v r|dfc S ��|dfS )aQ Return a directory containing .git, .hg, or pyproject.toml.
pyproject.toml files are only considered if they contain a [tool.black]
section and are ignored otherwise.
That directory will be a common parent of all files and directories
passed in `srcs`.
If no directory in the tree contains a marker that would specify it's the
project root, the root of the file system is returned.
Returns a two-tuple with the first element as the project root path and
the second element as a string describing the method by which the
project root was discovered.
Nc 3 �, �K � | ]}|d k r�n|V � �dS )�-N� )�.0�sr, s �r# � <genexpr>z$find_project_root.<locals>.<genexpr>B s/ �� � � �E�E�1�q�C�x�x�^�^�Q�E�E�E�E�E�Er* c �j � g | ]0}t t t j � � |� � � � ��1S r0 )r) r �cwd)r1 �srcs r# �
<listcomp>z%find_project_root.<locals>.<listcomp>F s0 � �H�H�H�C���d�h�j�j�#�!6�!6�7�7�H�H�Hr* c �j � g | ]0}t |j � � |� � � r|gng z ��1S r0 )�list�parents�is_dir)r1 r s r# r7 z%find_project_root.<locals>.<listcomp>J sG � � � � �CG��T�\������
�
�=�t�f�f�2�>�� � r* c 3 �4 K � | ]}t |� � V � �d S r&