o
    4Zc                     @   s&  d Z ddlZddlZddlZddlZddlZddlmZ ddlm	Z	 ddl
mZ ddlmZmZmZmZmZmZ ddlmZ dd	lmZmZmZmZ dd
lmZmZmZ ddlmZ ddl m!Z! ddl"m"Z" ddl#m$Z$m%Z%m&Z& ddl'm(Z( ddl)m*Z* h dZ+de! dZ,G dd dZ-			d2de.de%de/de/de/dedee- fddZ0	d3de%d ee. d!ee. ddfd"d#Z1dej2fd$d%Z3d4d&eee.  dee.ef fd'd(Z4d)edee.ee f fd*d+Z5	d3d&eee.  d,ee	 ddfd-d.Z6d3d&eee.  d,ee	 ddfd/d0Z7e8d1kre7  dS dS )5zSTool for sorting imports alphabetically, and automatically separated into sections.    N)gettext)TextIOWrapper)Path)AnyDictListOptionalSequenceUnion)warn   )__version__apifilessections)FileSkipped
ISortErrorUnsupportedEncoding)create_terminal_printer)	ASCII_ART)profiles)VALID_PY_TARGETSConfigfind_all_configs)Trie)	WrapModes>   -ac-af-ca-cs-df-ds-dt-ff-le-ls-ot-rr-sd-sg-sl-sp-tc-wl-ws-fas-fgw-fss-lai-lbt-nis-nlb-fass
a  

Nothing to do: no files or paths have have been passed in!

Try one of the following:

    `isort .` - sort all Python files, starting from the current directory, recursively.
    `isort . --interactive` - Do the same, but ask before making any changes.
    `isort . --check --diff` - Check to see if imports are correctly sorted within this project.
    `isort --help` - In-depth information about isort's available command-line options.

Visit https://pycqa.github.io/isort/ for complete information about how to use isort.
c                   @   s&   e Zd ZdedededdfddZdS )SortAttemptincorrectly_sortedskippedsupported_encodingreturnNc                 C   s   || _ || _|| _d S N)r9   r:   r;   )selfr9   r:   r;    r?   @/var/www/chikooza/env/lib/python3.10/site-packages/isort/main.py__init__D   s   
zSortAttempt.__init__)__name__
__module____qualname__boolrA   r?   r?   r?   r@   r8   C   s    r8   F	file_nameconfigcheckask_to_applywrite_to_stdoutkwargsr<   c           	   
   K   s\  d}d}zF|r(zt j| fd|i| }W n ty    d}Y nw t||dW S zt j| f|||d| }W n tyC   d}Y nw t||dW S  ttfyi } ztd|  d|  W Y d }~d S d }~w ty   |j	rytd|   t||d Y S  t
y } zt|t|d td	 W Y d }~d S d }~w ty   t|| d
  w )NFrG   T)rG   rI   rJ   zUnable to parse file z due to zEncoding not supported for )messager   )offending_file)r   
check_filer   r8   	sort_fileOSError
ValueErrorr   r   verboser   _print_hard_failstrsysexit	Exception)	rF   rG   rH   rI   rJ   rK   r9   r:   errorr?   r?   r@   sort_importsJ   sP   rY   rM   rL   c                 C   s6   |p	d|pd d}t | j| j| jd}|| dS )z4Fail on unrecoverable exception with custom message.z,Unrecoverable exception thrown when parsing  zj!This should NEVER happen.
If encountered, please open an issue: https://github.com/PyCQA/isort/issues/newcolorrX   successN)r   color_outputformat_errorformat_successrX   )rG   rM   rL   printerr?   r?   r@   rS   v   s   rS   c               
   C   s	  t jddd} | d}| d}| d}| }| d}| d}|jd	d
dt jtdd |jdddddd |jdddtdd |jdddddd |jddddd d! |jd"d#dd$d! |jd%d&dd'd(d |jd)d*d+d,dd- |jd.d/d0dd- |jd1d2dd3d! |jd4d5dd6d! |jd7d8d9dd:d! |jd;d<d=dd>d?d |jd@dAddBdCd |jdDdEdFdGdHdIdJ |jdKdLdMdNdJ |jdOdPddQd! |jdRdStdTdU	t
  dVdW |jdXdYdZdd[d! |jd\d]d^d_td`dadb |jdcdddeddfd! |jdgdhddid! |jdjdkdldJ |jdmdndodJ |jdpdqdrds |jdtduddvd! |jdwdxdydzd{d- |jd|d}d~d{d- |jddddd{d- |jdddd{d- |jdddddd |jddddd{dd! |jddd{dd! |jddddd! |jddddJ |jddddd |jdddd{dd! |jdddddd! |jdddddd! |jdddd{dd! |jddddd! |jddddd! |jdddddd! |jdddddd! |jdddddd! |jdddddd! |jddd`dtdddō |jddddtdʍ |jdddtd΍ |jdddtd΍ |jdddtd΍ |jdddddJ |jdddddd- |jdddddd- |jdddttj dd tj D  tdd |jdddddd! |jdddddd! |jdddddd! |jdddddd! |jdddddd! |jddddd! |jdd ddJ |jdddddd! |jdddd	d{d- |jd
ddddd! |jdddddd! |jddddddtdʍ |jdddtddW |jddddd! |jdd dd!d! |jd"d#dd$d! |jd%d&d{d'd! |jd(d)dd*d! |jd+d,td-dW |jd.d/dd0d! |jd1d2d3dJ |jd4d5d6dd- |jd7d8d9d:ttj dJ |jd;d<d=dd>d! |jd?d@dAdBdd- |jdCdDddEdFd |jdGdHddIdJd |jdKdLddMdNd |jdOdPddQdRd |jdSdTddUdVd |jdWdXdYdZd{d- |jd[d\d]dd^d! |jd_d`dadbd{d- |jdcddded{dfd! |jdgdhdid{djd! |jdkdld{dmd! |jdndodpd{dqd! |jdrdsdtd{dud! |jdvdwdxd{dyd! |jdzd{d{d|d! |jd}d~ddJ |jddddJ |jddddttd dtjj tjj dd |jddddt jd |jddddt jd |jddddt jd |jddddt jd |jddddt jd |jdddddt jd | S (  Na  Sort Python import definitions alphabetically within logical sections. Run with no arguments to see a quick start guide, otherwise, one or more files/directories/stdin must be provided. Use `-` as the first argument to represent stdin. Use --interactive to use the pre 5.0.0 interactive behavior. If you've used isort 4 but are new to isort 5, see the upgrading guide: https://pycqa.github.io/isort/docs/upgrade_guides/5.0.0.htmlF)descriptionadd_helpzgeneral optionstarget optionszgeneral output optionszsection output optionszdeprecated optionsz-hz--helphelpzshow this help message and exitactiondefaultre   z-Vz	--version
store_trueshow_versionz2Displays the currently installed version of isort.)rg   destre   z--vnz--version-numberversionz8Returns just the current version number without the logo)rg   rl   re   z-vz	--verboserR   zSShows verbose output, such as when files are skipped or when a check is successful.z--only-modifiedz--omonly_modifiedz1Suppresses verbose output for non-modified files.)rk   rg   re   z--dedup-headingsdedup_headingszTells isort to only show an identical custom import heading comment once, even if there are multiple sections with the comment set.z-qz--quietquietz4Shows extra quiet output, only errors are outputted.z-dz--stdoutz6Force resulting output to stdout, instead of in-place.rJ   )re   rk   rg   z--overwrite-in-placezTells isort to overwrite in place using the same file handle. Comes at a performance and memory usage penalty over its standard approach but ensures all file flags and modes stay unchanged.overwrite_in_placez--show-configshow_configzDSee isort's determined config, as well as sources of config options.z--show-files
show_fileszHSee the files isort will be run against with the current config options.z--dfz--diff	show_diffz\Prints a diff of all the changes isort would make to a file, instead of changing it in placez-cz--check-onlyz--checkrH   zChecks the file for unsorted / unformatted imports and prints them to the command line without modifying the file. Returns 0 when nothing would change and returns 1 when the file would be reformatted.z--wsz--ignore-whitespaceignore_whitespacezMTells isort to ignore whitespace differences when --check-only is being used.z--spz--settings-pathz--settings-filez
--settingssettings_pathz\Explicitly set the settings path or file instead of auto determining based on file location.)rk   re   z--crz--config-rootconfig_rootzExplicitly set the config root for resolving all configs. When used with the --resolve-all-configs flag, isort will look at all sub-folders in this config root to resolve config files and sort files based on the closest available config(if any)z--resolve-all-configsresolve_all_configszoTells isort to resolve the configs for all sub-directories and sort files in terms of its closest config files.z	--profileprofilez>Base profile type to use for configuration. Profiles include: , z!. As well as any shared profiles.)rk   typere   z--old-findersz--magic-placementold_finderszSUse the old deprecated finder logic that relies on environment introspection magic.z-jz--jobsz'Number of files to process in parallel.jobs?)re   rk   rz   nargsconstz--acz--atomicatomiczMEnsures the output doesn't save if the resulting file contains syntax errors.z--interactiverI   z+Tells isort to apply changes interactively.z--format-errorr_   z)Override the format used to print errors.z--format-successr`   z*Override the format used to print success.r   *?One or more Python source files that need their imports sorted.r   re   z--filter-filesfilter_filesz_Tells isort to filter files even when they are explicitly passed in as part of the CLI command.z-sz--skipzFiles that isort should skip over. If you want to skip multiple files you should specify twice: --skip file1 --skip file2. Values can be file names, directory names or file paths. To skip all files in a nested path use --skip-glob.skipappendz--extend-skipa  Extends --skip to add additional files that isort should skip over. If you want to skip multiple files you should specify twice: --skip file1 --skip file2. Values can be file names, directory names or file paths. To skip all files in a nested path use --skip-glob.extend_skipz--sgz--skip-globz"Files that isort should skip over.	skip_globz--extend-skip-globzEAdditional files that isort should skip over (extending --skip-glob).extend_skip_globz--gitignorez--skip-gitignoreskip_gitignorezTreat project as a git repository and ignore files listed in .gitignore.
NOTE: This requires git to be installed and accessible from the same shell as isort.z--extz--extensionz--supported-extensionsupported_extensionsz3Specifies what extensions isort can be run against.z--blocked-extensionblocked_extensionsz9Specifies what extensions isort can never be run against.z--dont-follow-linksdont_follow_linkszQTells isort not to follow symlinks that are encountered when running recursively.z
--filenamefilenamez.Provide the filename associated with a stream.z--allow-rootzQTells isort not to treat / specially, allowing it to be run against the root dir.z-az--add-importadd_importszYAdds the specified import line to all files, automatically determining correct placement.z--appendz--append-onlyappend_onlyzVOnly adds the imports specified in --add-import if the file contains existing imports.z--afz--force-adds
force_addsz6Forces import adds even if the original file is empty.z--rmz--remove-importremove_importsz,Removes the specified import from all files.z--float-to-topfloat_to_topa  Causes all non-indented imports to float to the top of the file having its imports sorted (immediately below the top of file comment).
This can be an excellent shortcut for collecting imports every once in a while when you place them in the middle of a file to avoid context switching.

*NOTE*: It currently doesn't work with cimports and introduces some extra over-head and a performance penalty.z--dont-float-to-topdont_float_to_topzKForces --float-to-top setting off. See --float-to-top for more information.z--caz--combine-ascombine_as_importsz%Combines as imports on the same line.z--csz--combine-starcombine_starzWEnsures that if a star import is present, nothing else is imported from that namespace.z-ez
--balancedbalanced_wrappingzEBalances wrapping to produce the most consistent line length possiblez--ffz--from-first
from_firstzXSwitches the typical ordering preference, showing from imports first then straight ones.z--fgwz--force-grid-wrap   force_grid_wrapzForce number of from imports (defaults to 2 when passed as CLI flag without value) to be grid wrapped regardless of line length. If 0 is passed in (the global default) only line length is considered.)r   r   rz   rk   re   z-iz--indentz:String to place for indents defaults to "    " (4 spaces).indent)re   rk   rz   z--lbiz--lines-before-importslines_before_imports)rk   rz   z--laiz--lines-after-importslines_after_importsz--lbtz--lines-between-typeslines_between_typesz--lez--line-endingline_endingzXForces line endings to the specified value. If not set, values will be guessed per-file.z--lsz--length-sortz$Sort imports by their string length.length_sortz--lssz--length-sort-straightzSort straight imports by their string length. Similar to `length_sort` but applies only to straight imports and doesn't affect from imports.length_sort_straightz-mz--multi-linemulti_line_outputc                 S   s   g | ]}t |jqS r?   )rT   value).0moder?   r?   r@   
<listcomp>  s    z%_build_arg_parser.<locals>.<listcomp>zMulti line output (0-grid, 1-vertical, 2-hanging, 3-vert-hanging, 4-vert-grid, 5-vert-grid-grouped, 6-deprecated-alias-for-5, 7-noqa, 8-vertical-hanging-indent-bracket, 9-vertical-prefix-from-module-import, 10-hanging-indent-with-parentheses).)rk   choicesrz   re   z-nz --ensure-newline-before-commentsensure_newline_before_commentsz:Inserts a blank line before a comment following an import.z--nisz--no-inline-sortno_inline_sortzULeaves `from` imports with multiple imports 'as-is' (e.g. `from foo import a, c ,b`).z--otz--order-by-typeorder_by_typea
  Order imports by type, which is determined by case, in addition to alphabetically.

**NOTE**: type here refers to the implied type from the import name capitalization.
 isort does not do type introspection for the imports. These "types" are simply: CONSTANT_VARIABLE, CamelCaseClass, variable_or_function. If your project follows PEP8 or a related coding standard and has many imports this is a good default, otherwise you likely will want to turn it off. From the CLI the `--dont-order-by-type` option will turn this off.z--dtz--dont-order-by-typedont_order_by_typea  Don't order imports by type, which is determined by case, in addition to alphabetically.

**NOTE**: type here refers to the implied type from the import name capitalization.
 isort does not do type introspection for the imports. These "types" are simply: CONSTANT_VARIABLE, CamelCaseClass, variable_or_function. If your project follows PEP8 or a related coding standard and has many imports this is a good default. You can turn this on from the CLI using `--order-by-type`.z--rrz--reverse-relativereverse_relativez"Reverse order of relative imports.z--reverse-sortreverse_sortz!Reverses the ordering of imports.z--sort-order
sort_orderzSpecify sorting function. Can be built in (natural[default] = force numbers to be sequential, native = Python's built-in sorted function) or an installable plugin.z--slz--force-single-line-importsforce_single_linez3Forces all from imports to appear on their own linez--nslz--single-line-exclusionsz9One or more modules to exclude from the single line rule.single_line_exclusionsz--tcz--trailing-commainclude_trailing_commazIIncludes a trailing comma on multi line imports that include parentheses.z--upz--use-parenthesesuse_parentheseszUse parentheses for line continuation on length limit instead of slashes. **NOTE**: This is separate from wrap modes, and only affects how individual lines that  are too long get continued, not sections of multiple imports.z-lz-wz--line-lengthz--line-widthzBThe max length of an import line (used for wrapping long imports).line_lengthz--wlz--wrap-lengthwrap_lengthzSpecifies how long lines that are wrapped should be, if not set line_length is used.
NOTE: wrap_length must be LOWER than or equal to line_length.z--case-sensitivecase_sensitivez7Tells isort to include casing when sorting module namesz--remove-redundant-aliasesremove_redundant_aliaseszTells isort to remove redundant aliases from imports, such as `import os as os`. This defaults to `False` simply because some projects use these seemingly useless  aliases to signify intent and change behaviour.z--honor-noqa
honor_noqazFTells isort to honor noqa comments to enforce skipping those comments.z--treat-comment-as-codetreat_comments_as_codezNTells isort to treat the specified single line comment(s) as if they are code.z--treat-all-comment-as-codetreat_all_comments_as_codezBTells isort to treat all single line comments as if they are code.z--formatter	formatterzGSpecifies the name of a formatting plugin to use when producing output.z--colorr^   z,Tells isort to use color in terminal output.z--ext-format
ext_formatzRTells isort to format the given files according to an extensions formatting rules.z--star-firstzQForces star imports above others to avoid overriding directly imported variables.
star_firstz--sdz--section-defaultdefault_sectionz-Sets the default section for import options: z--only-sectionsz--osonly_sectionszCauses imports to be sorted based on their sections like STDLIB, THIRDPARTY, etc. Within sections, the imports are ordered by their import style and the imports with the same style maintain their relative positions.z--dsz--no-sectionsz,Put all imports into the same section bucketno_sectionsz--fasz--force-alphabetical-sortforce_alphabetical_sortz2Force all imports to be sorted as a single sectionz--fssz--force-sort-within-sectionsforce_sort_within_sectionszDon't sort straight-style imports (like import sys) before from-style imports (like from itertools import groupby). Instead, sort the imports by module, independent of import style.z--hcssz%--honor-case-in-force-sorted-sections#honor_case_in_force_sorted_sectionszHonor `--case-sensitive` when `--force-sort-within-sections` is being used. Without this option set, `--order-by-type` decides module name ordering too.z--srssz(--sort-relative-in-force-sorted-sections&sort_relative_in_force_sorted_sectionsz}When using `--force-sort-within-sections`, sort relative imports the same way as they are sorted when not using that setting.z--fassz)--force-alphabetical-sort-within-sections'force_alphabetical_sort_within_sectionsz>Force all imports to be sorted alphabetically within a sectionz-tz--topz?Force specific imports to the top of their appropriate section.force_to_topz--combine-straight-importsz--csicombine_straight_importsz}Combines all the bare straight imports of the same section in a single line. Won't work with sections which have 'as' importsz--nlbz--no-lines-beforez?Sections which should not be split with previous by empty linesno_lines_beforez--srcz
--src-path	src_pathszAdd an explicitly defined source path (modules within src paths have their imports automatically categorized as first_party). Glob expansion (`*` and `**`) is supported for this option.z-bz	--builtinknown_standard_libraryzGForce isort to recognize a module as part of Python's standard library.z--extra-builtinextra_standard_libraryzNExtra modules to be included in the list of ones in Python's standard library.z-fz--futureknown_future_librarya  Force isort to recognize a module as part of Python's internal future compatibility libraries. WARNING: this overrides the behavior of __future__ handling and therefore can result in code that can't execute. If you're looking to add dependencies such as six, a better option is to create another section below --future using custom sections. See: https://github.com/PyCQA/isort#custom-sections-and-ordering and the discussion here: https://github.com/PyCQA/isort/issues/1463.z-oz--thirdpartyknown_third_partyzIForce isort to recognize a module as being part of a third party library.z-pz	--projectknown_first_partyzNForce isort to recognize a module as being part of the current python project.z--known-local-folderknown_local_folderzForce isort to recognize a module as being a local folder. Generally, this is reserved for relative imports (from . import module).z--virtual-envvirtual_envzKVirtual environment to use for determining whether a package is third-partyz--conda-env	conda_envzIConda environment to use for determining whether a package is third-partyz--pyz--python-versionstore
py_version)autoa  Tells isort to set the known standard library based on the specified Python version. Default is to assume any Python 3 version could be the target, and use a union of all stdlib modules across versions. If auto is specified, the version of the interpreter used to run isort (currently: z) will be used.)rg   rk   r   re   z--recursivedeprecated_flagsappend_const)rk   rg   r   re   z-rcz--dont-skipz-nsz--applyz-kz--keep-direct-and-as)argparseArgumentParseradd_argument_groupadd_mutually_exclusive_groupadd_argumentSUPPRESS_r   rT   joinr   keysintlistr   __members__valuesr   DEFAULTtupler   rU   version_infomajorminor)parsergeneral_grouptarget_groupoutput_groupinline_args_groupsection_groupdeprecated_groupr?   r?   r@   _build_arg_parser   sh  





			

		
				r   argvc                 C   s  | d u rt jdd  nt| } g }t| D ]\}}|tv r)|| d| | |< qt }dd t|| 	 D }|rA||d< d|v rLd|d< |d= d	|v rWd|d
< |d	= d|v rn|d= |
ddrjt d nd|d< |
dd }|r| rtt||d< |S t| |d< |S )Nr   -c                 S   s   i | ]	\}}|r||qS r?   r?   )r   keyr   r?   r?   r@   
<dictcomp>  s    zparse_args.<locals>.<dictcomp>remapped_deprecated_argsr   Fr   r   follow_linksr   r   z6Can't set both --float-to-top and --dont-float-to-top.r   )rU   r   r   	enumerateDEPRECATED_SINGLE_DASH_ARGSr   r   vars
parse_argsitemsgetrV   isdigitr   r   )r   r   indexargr   	argumentsr   r?   r?   r@   r     s:   
r   itemc                 C   sl   t | ttfrt| S t | trt| jS t | trt| S t| r,t	| dr,t| j
S td| t| )z=Preconverts objects from native types into JSONifyiable typesrB   z#Unserializable object {} of type {})
isinstanceset	frozensetr   r   rT   namer   callablehasattrrB   	TypeErrorformatrz   )r  r?   r?   r@   _preconvert  s   



r
  stdinc           	      C   s  t jdd}|jdddd |jddd	d
d |d}|jddd	dd | }|jddd	dd |jdddtjjd	dd |jdddtjjd	dd |jdddtjj	d	dd |
| }|j}|dgkrztj|d u rotjn||j|j|jd}ntj||j|j|jd}|D ]:}|jtjjkrt|jdd  q|jtjjkrt|j q|jtjj	krt|j d|j  qtt| qd S )Nz^Get all import definitions from a given file.Use `-` as the first argument to represent stdin.)rb   r   +r   r   z
--top-onlyri   Fz@Only identify imports that occur in before functions or classes.rf   rd   z--follow-linkszMTells isort to follow symlinks that are encountered when running recursively.z--uniquez1If true, isort will only identify unique imports.z
--packagesuniquestore_constzHIf true, isort will only identify the unique top level modules imported.)rk   rg   r   rh   re   z	--modulesz>If true, isort will only identify the unique modules imported.z--attributeszAIf true, isort will only identify the unique attributes imported.r   )r  top_onlyr   .r   )r   r   r   r   r   r   	ImportKeyPACKAGEMODULE	ATTRIBUTEr   r   find_imports_in_streamrU   r  r  r  r   find_imports_in_pathsprintmodulesplit	attributerT   )	r   r  r   r   
uniquenessr   
file_namesidentified_importsidentified_importr?   r?   r@   identify_imports_main  s   

	
r  c           $         sV  t | }|drtt d S |dd}|dd}|r$|r$td d|v rOtj	|d rEtj
|d |d< tj|d |d< n
tj
|d |d< d|v rp|d }tj
||d< tj|d sptd	|d   |d
g }|s|stt |rtd d S d|vrtj
|r|d ndpt |d< tj|d stj|d |d< | }|dd |dd }|dd|dd|dd|dd}	|dd}
|dd }|dd |dd }|dd}d}d}d}d |rt|ddd|v rdd |ddD |d< tdi ||r2ttjjddtd  d S |d!gkr|r?t|nd }|rItd" |d u rQtjn|}retj||d# }|}nqztj|tj|dd$ W n` ty   tj|  Y nNw d%|v r|st j!j"j#d&}|$d' |$d( td) n*|rt j!j"j#d&}|$d* td) g }g }j%rg }|D ]}&t|r|'| q|'| q|}t()|||}|r |D ]}t| qd S d}d}d}j*rtt |r4dd l+}|,|dkr|n|- }|.t/j0t1 d+|}n fd,d-|D }d.}d} |D ],}!|!sPqI|!j2}|ddr_|r_d.}|!j3rg|d)7 }|!j4sp|d)7 }nd.} d}qI|t5|7 }|rj6sj*r|D ]
}"t|" d/ qtd0| d1 |t5|7 }|rj6sj*r|D ]
}#t|# d2 qtd3| d4 |dkr|rd.}|dkr| sd.}j6s |
s|	r |
rtd5d67|
 d7 |	rtd8d67|	 d7 td9 |rtd) |rtd) |r)t j!j"j#d&}|$d: td) d S d S );Nrj   rq   Frr   z9Error: either specify show-config or show-files not both.ru   settings_filer   z virtual_env dir does not exist: r   z8Error: arguments passed in without any paths or content.r   r  rI   r|   rH   rs   rJ   r   r   r   r   
allow_rootrw   rv   r   c                 S   s   h | ]}t | qS r?   )r   resolve)r   src_pathr?   r?   r@   	<setcomp>P  s    zmain.<locals>.<setcomp>r?      ),z: )r   
separatorsrh   r   z,Error: can't show files for streaming input.)input_streamrG   rs   	file_path	extension)r(  output_streamrG   rs   r)  r*  raise_on_skip/r[   z-it is dangerous to operate recursively on '/'z*use --allow-root to override this failsafer   z:Filename override is intended only for stream (-) sorting.)rG   rH   rI   rJ   r*  config_triec                 3   s(    | ]}t | d V  qdS ))rG   rH   rI   rs   rJ   r*  r.  N)rY   )r   rF   rI   rH   rG   r.  r   rs   rJ   r?   r@   	<genexpr>  s    
zmain.<locals>.<genexpr>Tz was skipped as it's listed in 'skip' setting, matches a glob in 'skip_glob' setting, or is in a .gitignore file with --skip-gitignore enabled.zSkipped z filesz/ was broken path, make sure it exists correctlyzBroken z pathszPW0502: The following deprecated single dash CLI flags were used and translated: ry   !zAW0501: The following deprecated CLI flags were used and ignored: zgW0500: Please see the 5.0.0 Upgrade guide: https://pycqa.github.io/isort/docs/upgrade_guides/5.0.0.htmlzNo valid encodings.)8r   r   r  r   poprU   rV   ospathisfileabspathdirnameisdirr   QUICK_GUIDEgetcwdcopyr   r   jsondumps__dict__r
  r   r  r   check_streamsort_streamstdoutr   writereadr   r^   r_   r`   rX   r   
is_skippedr   r   findrR   multiprocessingPool	cpu_countimap	functoolspartialrY   r9   r:   r;   lenro   r   )$r   r  r   rq   rr   venvr  config_dictr|   r   r   stream_filenamer!  rw   wrong_sorted_filesall_attempt_brokenno_valid_encodingsr)  r(  r9   ra   r:   brokenfiltered_filesrF   num_skipped
num_brokennum_invalid_encodingrF  executorattempt_iteratoris_no_attemptany_encoding_validsort_attemptwas_skipped
was_brokenr?   r/  r@   main  s  






	



	



r_  __main__)FFF)NNr=   )9__doc__r   rJ  r<  r3  rU   r   r   ior   pathlibr   typingr   r   r   r   r	   r
   warningsr   rZ   r   r   r   r   
exceptionsr   r   r   r	  r   logor   r   settingsr   r   r   utilsr   
wrap_modesr   r   r9  r8   rT   rE   rY   rS   r   r   r   r
  r  r_  rB   r?   r?   r?   r@   <module>   s     

-
      $"

$V 
o
