Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
config.cpython-313.pyc64 linesDownload Raw Back to __pycache__
1�

2�j���@�%SSKJr SSKrSSKrSSKrSSKrSSKJr 0rS\	S'\RR\RRS5S5r
\RRS\
5r\R4S	jrS3rSSjr\"\\5 \"\5 g)
�)�annotationsN)�Anyzdict[str, dict[str, Any]]�conf�~z.config/fsspec�FSSPEC_CONFIG_DIRc	�v�[U5n/nUGH+nURS5(a�[U5S:�a�USS:wa�[R"X5nXAU'URS5S:�aURU5 Mw[U[5(aEURSS5upVURUR505RU5 M�[R"SUS[!U535 M�URS5(dGM[R"SUS35 GM. UHKnURSS	5upVnXURUR505UR5'MM g4![R5Ra XnGNXf=f)a�Set config values from environment variables6 7Looks for variables of the form ``FSSPEC_<protocol>`` and8``FSSPEC_<protocol>_<kwarg>``. For ``FSSPEC_<protocol>`` the value is parsed9as a json dictionary and used to ``update`` the config of the10corresponding protocol. For ``FSSPEC_<protocol>_<kwarg>`` there is no11attempt to convert the string value, but the kwarg keys will be lower-cased.12 13The ``FSSPEC_<protocol>_<kwarg>`` variables are applied after the14``FSSPEC_<protocol>`` ones.15 16Parameters17----------18conf_dict : dict(str, dict)19    This dict will be mutated20envdict : dict-like(str, str)21    Source for the values - usually the real environment22�FSSPEC_��_�zIgnoring environment variable z due to not being a dict: �FSSPECz! due to having an unexpected name�N)�dict�23startswith�len�json�loads�decoder�JSONDecodeError�count�append�24isinstance�split�25setdefault�lower�update�warnings�warn�type)�	conf_dict�envdict�26kwarg_keys�key�valuer�proto�kwargs        �SD:\code\apps\devtools\python\user_packages\Python313\site-packages\fsspec/config.py�set_conf_envr(su��&�7�m�G��J����>�>�)�$�$��S��A��#�a�&�C�-�
%��27�28�7�<�0��$����y�y��~��!��!�!�#�&���e�T�*�*�"�y�y��a�0�H�A��(�(������;�B�B�5�I��M�M�8���>� ��K�=�*���^�^�H�
%�
%��M�M�0���5V�W�
�)�0���)�)�C��+���%�AH��	���U�[�[�]�B�/����
�>���'�<�<�/�/�
%����
%�s�F�"F8�7F8c��[RRU5(dg[[R"U55nUGH.nURS5(a�[R"5nUR[RRX55 UH7nUS:XaMURU05R[XE55 M9 URS5(dM�[RX55n[R"U5nSSS5 WH/nURU05R[Xu55 M1 GM1 g!,(df   NI=f)auSet config values from files29 30Scans for INI and JSON files in the given dictionary, and uses their31contents to set the config. In case of repeated values, later values32win.33 34In the case of INI files, all values are strings, and these will not35be converted.36 37Parameters38----------39cdir : str40    Directory to search41conf_dict : dict(str, dict)42    This dict will be mutated43Nz.ini�DEFAULTz.json)�os�path�isdir�sorted�listdir�endswith�configparser�ConfigParser�read�joinrrr�openr�load)�cdirr �allfiles�fn�inir#�f�jss        r'�set_conf_filesr=@s��"�7�7�=�=������b�j�j��&�'�H���
�;�;�v����+�+�-�C��H�H�R�W�W�\�\�$�+�,����)�#���$�$�S�"�-�4�4�T�#�(�^�D���;�;�w����b�g�g�l�l�4�,�-���Y�Y�q�\��.����$�$�S�"�-�4�4�T�"�'�]�C���.�-�s�!E;�;44F		c��Uc[n[UR[[45(aUROUR/n0nUHnXR;dM45URX%5 M UR46"S0UD6 UnU$)a�Supply default values for kwargs when instantiating class47 48Augments the passed kwargs, by finding entries in the config dict49which match the classes ``.protocol`` attribute (one or more str)50 51Parameters52----------53cls : file system implementation54kwargs : dict55conf_dict : dict of dict56    Typically this is the global configuration57 58Returns59-------60dict : the modified set of kwargs61�)rr�protocol�tuple�listr)�cls�kwargsr �protos�kwr%s      r'�apply_configrGcss��"���	�'����u�d�m�D�D�S�\�\�3�<�<�.�F�	�B������I�I�i�&�'��62�I�I����
�F��M�)N)�63__future__rr1rr+r�typingrr�__annotations__r,r4�64expanduser�default_conf_dir�environ�get�conf_dirr(r=rGr?rHr'�<module>rQs���"���	���"$���$��7�7�<�<���� 2� 2�3� 7�9I�J��
�:�:�>�>�-�/?�@��%'�J�J�/N�d D�F�>�x����T�rH
codekingpro/portable-devtools · Team Ai