7f dZddlZddlZddlZddlmZddlmZmZm Z m Z ddl m Z ddl mZmZddlmZdd Zd e ed ed eede efd ZdededeefdZdS)zBLogic that powers autocompletion installed by ``pip completion``. N)chain)AnyIterableListOptional)create_main_parser) commands_dictcreate_command)get_default_environmentreturncdtjvrdStjdrtjdsdStjdddt tjd} |dz n#t $rdYnwxYwt }tt}g}d}D] }||vr|}n ||dkrtj d d o|d v}|rot} fd |d D}|r(|D]} t| tj d d o|d k} | r6t!dD]} t| tj dt#|} | jjD]5jt*jkr|fdjjzDz }6dd|dz Dfd|D}fd|D}t3|| jj} | rt!| }d|D}|D]:}|d}|dr|ddddkr|dz }t|;nd|jD}||jt;j|} dr-|D])jt*jkr|jjzz }*n0t3||} | rtt!| }tdfd|Dtj ddS)z:Entry Point for completion of main and subcommand options.PIP_AUTO_COMPLETEN COMP_WORDS COMP_CWORDhelp-)show uninstallctg|]4}|jr|jddv-|j5S)rN)canonical_name startswith).0distcwordslcs /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/cli/autocompletion.py z autocomplete..6sY&11"55'vabbz99#:99T) local_onlyinstallpathc"g|] }|jf S)nargs)ropt_stropts rrz autocomplete..Ns--4Wci(r cDg|]}|ddS)=r)splitrxs rrz autocomplete..Ss&DDDQWWS\\!_DDDr c&g|] \}}|v ||fSr%r%)rr-v prev_optss rrz autocomplete..Ts+FFFfq!1I3E3EAq63E3E3Er cHg|]\}}|||fSr%r)rkr/currents rrz autocomplete..Vs2GGGdag1F1FGAq6GGGr cg|]}|dfS)rr%)rr#s rrz autocomplete..as333Tay333r rz--r*cg|] }|j Sr%) option_list)ris rrz autocomplete..ks<<g|]}||Sr%r2)rr-r4s rrz autocomplete..xs*HHHa!,,w2G2GHHHHr ) osenvirongetr+int IndexErrorrlistr sysexitrr loweriter_installed_distributionsprintauto_complete_pathsr parseroption_list_allroptparse SUPPRESS_HELP _long_opts _short_optsget_path_completion_type option_groupsappendr8r from_iterablejoin)cwordrH subcommandsoptionssubcommand_namewordshould_list_installedenv installedrshould_list_installablesr# subcommandcompletion_typepathsoption opt_labeloptsflattened_optsr4rrr(r0s @@@@@r autocompletercs"*,, :>>, ' 'rz~~l/K/K Z % + + - -abb 1F  <( ) )E#  ! !F}%%KG&*O ;  "O E " f $ $ HQKKK$+$6$6s$;$; ;! T A  ! )++CB<<<MMI %  D$KKKK ""3'' ' HOy,H ! $ +GV<<  d HQKKK#O44 $4  Cx81118;8X EDfQ].CDDD FFFFFFFGGGGgGGG2     -    4'AAE33U333G  Fq Iay !VAYrr]d22S )      =CO#CCK D 7vunUUO R"#6w#P#PQQ  chhHHHH;HHHIIJJJHQKKKKKs" B.. B=<B=rrSrac|dks||dz dsdS|D]}|jtjkrt |dD]m}||dz dd|krC|jr1td|jdDr |jccSndS)aLGet the type of path completion (``file``, ``dir``, ``path`` or None) :param cwords: same as the environmental variable ``COMP_WORDS`` :param cword: same as the environmental variable ``COMP_CWORD`` :param opts: The available options to check :return: path completion type (``file``, ``dir``, ``path`` or None) r6rN/r*rc3K|]}|dvV dS))r#filedirNr%r,s r z+get_path_completion_type..s9**56A00******r )rrrJrKstrr+metavarany)rrSrar(os rrNrN|s qyyuqy)44S99yt'' 8x- - - S$$ ' 'Aeai &&s++A.!33{'c**:=+:K:KC:P:P***''';&&&&&  ' 4r r4r]c#Ktj|\}tj|}tj|tjsdStjfdtj|D}|D]}tj||}tjtj||}|dkr$tj |r|Vtj |r"tj|dVdS)atIf ``completion_type`` is ``file`` or ``path``, list all regular files and directories starting with ``current``; otherwise only list directories starting with ``current``. :param current: The word to be completed :param completion_type: path completion type(``file``, ``path`` or ``dir``) :return: A generator of regular files and/or directories Nc3K|]8}tj|4|V9dS)N)r<r#normcaser)rr-filenames rriz&auto_complete_paths..sZrw/?/?/B/B/M/Mh/W/W r rhr) r<r#r+abspathaccessR_OKrplistdirrRisfileisdir) r4r] directory current_path file_listfr( comp_filerqs @rrGrGsI'--00Ix7??9--L 9\27 + +w))H:l++I . .gll<++G$$RW\\)Q%?%?@@  e # #s(;(; #OOOO W]]3   .',,y"-- - - - . .r )r N)__doc__rJr<rB itertoolsrtypingrrrrpip._internal.cli.main_parserrpip._internal.commandsr r pip._internal.metadatar rcrjr?rNrGr%r rrs. 000000000000<<<<<<@@@@@@@@::::::jjjjZ I!)1# c]0..s.x}......r