Ë
    ÷Q(hÁ6  ã                   óÈ   — 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Z ej                  de«      Zd	„ Zd
„ Zdd„Zd„ Zd„ Zd e«       fd„Zd„ Zd„ Zdd„Zy)z>
My own variation on function-specific inspect-like features.
é    N)Úislice)Úopené   )ÚpformatzAargs varargs varkw defaults kwonlyargs kwonlydefaults annotationsÚFullArgSpecc                 óÌ  — d}	 | j                   }|j                  }t        j                  j	                  |«      svdj                  t        j                  | «      d   «      }d}|j                  d«      r7t        j                  d|«      j                  «       \  }}t        |«      }d|z  }|||fS t        |«      5 }|j                  }t        t!        ||dz
  d«      «      }ddd«       dj                  t        j"                  «      «      |fS # 1 sw Y   Œ0xY w#  t%        | d«      r(t'        | j                   j)                  «       «      |d	fcY S t+        | «      |d	fcY S xY w)
a/  Attempts to retrieve a reliable function code hash.

    The reason we don't use inspect.getsource is that it caches the
    source, whereas we want this to be modified on the fly when the
    function is modified.

    Returns
    -------
    func_code: string
        The function code
    source_file: string
        The path to the file in which the function is defined.
    first_line: int
        The first line of the code in the source file.

    Notes
    ------
    This function does a bit more magic than inspect, and is thus
    more robust.
    NÚ r   r   z	<doctest z\<doctest (.*\.rst)\[(.*)\]\>z<doctest %s>Ú__code__éÿÿÿÿ)r
   Úco_filenameÚosÚpathÚexistsÚjoinÚinspectÚgetsourcelinesÚ
startswithÚreÚmatchÚgroupsÚintÚopen_py_sourceÚco_firstlinenoÚlistr   ÚgetblockÚhasattrÚstrÚ__hash__Úrepr)ÚfuncÚsource_fileÚcodeÚsource_codeÚline_noÚsource_file_objÚ
first_lineÚsource_liness           úQ/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/joblib/func_inspect.pyÚget_func_coder)      sT  € ð* €Kð /Ø�}‰}ˆØ×&Ñ&ˆÜ�w‰w�~‰~˜kÔ*ð Ÿ'™'¤'×"8Ñ"8¸Ó">¸qÑ"AÓBˆKØˆGØ×%Ñ% kÔ2Ü')§x¡xØ4°kó(ç‘&“(ñ %�˜Wô ˜g›,�Ø,¨{Ñ:�Ø ¨WÐ4Ð4ä˜KÓ(ð 	O¨OØ×,Ñ,ˆJä¤ ¸
ÀQ¹ÈÓ MÓNˆL÷	Oð �w‰w”w×'Ñ'¨Ó5Ó6¸ÀZÐOÐO÷		Oð 	Oûð
/ô �4˜Ô$ä�t—}‘}×-Ñ-Ó/Ó0°+¸rÐAÒAô ˜“:˜{¨BÐ.Ò.ús0   „B,D Â1D Â<&DÃ".D ÄDÄD Ä4E#ÅE#c                 ó²   — ddl }t        |d«      r|j                  }nddl}|j                  j                  }dD ]  }| j                  | ||«      «      } Œ | S )z2Windows cannot encode some characters in filename.r   NÚquote)ú<ú>ú!ú:ú\)Úurllibr   r+   Úurllib.parseÚparseÚreplace)Ústringr1   r+   Úchars       r(   Ú_clean_win_charsr7   R   sT   € ãäˆv�wÔØ—‘‰ó 	à—‘×"Ñ"ˆØ*ò 3ˆØ—‘ ¡e¨D£kÓ2‰ð3à€Mó    c                 ó`  — t        | d«      r| j                  }n	 t        j                  | «      }|€d}|dk(  rð	 t        j                  j                  t        j                  | «      «      }|�»|j                  t        j                  «      }|d   j                  d«      r2|d   j                  d	«      }d	j                  |dd
 |dd z   «      |d<   n't        |«      d
kD  r|d   j                  d«      rd|d<   d	j                  |«      }|j                  d«      r|dd }|d	z   |z   }|j                  d«      }t        | d«      r| j                   }nt        | d«      r| j"                  }nd}|r0t        | d«      r$|| j$                  v r| j$                  |   | urd|z  }t        | d«      r<| j&                  |k7  r-|j)                  | j&                  j                  d«      dd «       t        j*                  | «      r3t        | d«      r'| j,                  }|j/                  |j"                  «       t        j0                  dk(  r%|r#t3        |«      }|D �	cg c]  }	t3        |	«      ‘Œ }}	||fS # t        $ r) t        | d«      r| j
                  j                  }nd}Y �Œmw xY w#  d}Y �Œ<xY wc c}	w )a¹  Return the function import path (as a list of module names), and
    a name for the function.

    Parameters
    ----------
    func: callable
        The func to inspect
    resolv_alias: boolean, optional
        If true, possible local aliases are indicated.
    win_characters: boolean, optional
        If true, substitute special characters using urllib.quote
        This is useful in Windows, as it cannot encode some filenames
    Ú
__module__Ú	__class__ÚunknownNr	   Ú__main__r   z<ipython-inputú-é   é   éþÿÿÿÚ
ipykernel_Ú	ipykernelz.pyéýÿÿÿú.Ú	func_nameÚ__name__Úfunc_globalsz%s-aliasÚ__qualname__Úim_classÚnt)r   r:   r   Ú	getmoduleÚ	TypeErrorr;   r   r   ÚabspathÚgetsourcefileÚsplitÚsepr   r   ÚlenÚendswithrF   rG   rH   rI   ÚextendÚismethodrJ   ÚappendÚnamer7   )
r    Úresolv_aliasÚwin_charactersÚmoduleÚfilenameÚpartsrP   rW   ÚklassÚss
             r(   Úget_func_namer_   b   sz  € ô ˆt�\Ô"Ø—‘‰ð	#Ü×&Ñ& tÓ,ˆFð €~àˆØ�Òð	Ü—w‘w—‘¤w×'<Ñ'<¸TÓ'BÓCˆHð Ðà—N‘N¤2§6¡6Ó*ˆEØ�R‰y×#Ñ#Ð$4Ô5ð ˜b™	Ÿ™¨Ó,�ØŸH™H U¨2¨A Y°°q°r°Ñ%:Ó;��b’	Ü�U“˜a’ E¨"¡I×$8Ñ$8¸Ô$Fð (��b‘	Ø—x‘x “ˆHØ× Ñ  Ô'Ø# C R˜=�Ø˜c‘\ HÑ,ˆFØ�\‰\˜#Ó€FÜˆt�[Ô!Ø�~‰~‰Ü	��zÔ	"Ø�}‰}‰àˆáä�4˜Ô(¨T°T×5FÑ5FÑ-FØ× Ñ  Ñ&¨dÑ2Ø! DÑ(�Üˆt�^Ô$¨×):Ñ):¸dÒ)Bð 	�‰�d×'Ñ'×-Ñ-¨cÓ2°3°BÐ7Ô8Ü×Ñ˜Ôä�4˜Ô$Ø—M‘MˆEØ�M‰M˜%Ÿ.™.Ô)Ü	‡w�w�$‚™>ä Ó%ˆØ/5Ö6¨!Ô" 1Õ%Ð6ˆÐ6Ø�4ˆ<ÐøôI ò 	#Ü�t˜[Ô)ØŸ™×2Ñ2‘à"�úð		#ûð	Ø‹Hüòn 7s"   ›I, º2J! ÉJ+É,.JÊJÊ!J(c                 ó&   — dj                  | |«      S )z.Helper function to output a function signaturez{}{})Úformat)Úfunction_nameÚarg_sigs     r(   Ú_signature_strrd   ¼   s   € à�=‰=˜¨Ó0Ð0r8   c                 ó”   — d}t        |«      dd }dj                  d„ |j                  «       D «       «      }|j                  | ||«      S )z)Helper function to output a function callz{0}({1}, {2})r   r   ú, c              3   ó0   K  — | ]  \  }}|›d |›�–— Œ y­w)ú=N© )Ú.0ÚkÚvs      r(   ú	<genexpr>z'_function_called_str.<locals>.<genexpr>Æ   s   è ø€ ÒG±°°1¢a©Ô+ÑGùs   ‚)r   r   Úitemsra   )rb   ÚargsÚkwargsÚtemplate_strÚargs_strÚ
kwargs_strs         r(   Ú_function_called_strrt   Á   sF   € à"€Lä�D‹z˜!˜BÐ€HØ—‘ÑG¸¿¹»ÔGÓG€JØ×Ñ˜}¨h¸
ÓCÐCr8   ri   c                 ó<  — t        |«      }t        |t        «      rt        d|›dt	        |«      ›d�«      ‚t        j                  | «      s6t        j                  | «      s!|rt        j                  d| z  d¬«       ||dœS t        j                  | «      }g }g }g }d}d}	|j                  j                  «       D �]  }
|
j                  |
j                  u r|j                  |
j                   «       n˜|
j                  |
j"                  u r7|j                  |
j                   «       |j                  |
j                   «       nI|
j                  |
j$                  u r|
j                   }n$|
j                  |
j&                  u r|
j                   }	|
j(                  |
j*                  usŒé|j                  |
j(                  «       �Œ t        j                  | «      rS| j,                  g|z   }t        j                  | j.                  «      }t1        t3        |j                  «      «      }|g|z   }t5        | d	¬
«      \  }}t7        «       }d}t9        |«      D ]n  \  }}|t;        |«      k  r7||vr	||   ||<   Œ!t        d|›dt=        ||«      ›dt?        |||«      ›d�«      ‚|t;        |«      z
  }||v r	||   ||<   Œf	 ||   ||<   Œp t7        «       }tE        |jG                  «       «      D ](  \  }}||v r|||<   Œ|	�|||<   ŒtI        d|›d|›d�«      ‚ |	�||d<   |�||dz   d }||d<   |D ]2  }||v r|jK                  |«       Œt        d|›dt=        ||«      ›�«      ‚ |S # t@        tB        f$ r-}t        dt=        ||«      ›dt?        |||«      ›d�«      |‚d}~ww xY w)aX  Filters the given args and kwargs using a list of arguments to
    ignore, and a function specification.

    Parameters
    ----------
    func: callable
        Function giving the argument specification
    ignore_lst: list of strings
        List of arguments to ignore (either a name of an argument
        in the function spec, or '*', or '**')
    *args: list
        Positional arguments passed to the function.
    **kwargs: dict
        Keyword arguments passed to the function

    Returns
    -------
    filtered_args: list
        List of filtered positional and keyword arguments.
    z2ignore_lst must be a list of parameters to ignore z (type z) was givenz4Cannot inspect object %s, ignore list will not work.r?   )Ú
stacklevel)Ú*ú**NF)rX   r   zKeyword-only parameter 'z)' was passed as positional parameter for z:
     z was called.zWrong number of arguments for zIgnore list for z,() contains an unexpected keyword argument 'ú'rx   r   rw   zIgnore list: argument 'z' is not defined for function )&r   Ú
isinstancer   Ú
ValueErrorÚtyper   rU   Ú
isfunctionÚwarningsÚwarnÚ	signatureÚ
parametersÚvaluesÚkindÚPOSITIONAL_OR_KEYWORDrV   rW   ÚKEYWORD_ONLYÚVAR_POSITIONALÚVAR_KEYWORDÚdefaultÚemptyÚ__self__Ú__func__ÚnextÚiterr_   ÚdictÚ	enumeraterR   rd   rt   Ú
IndexErrorÚKeyErrorÚsortedrn   rM   Úpop)r    Ú
ignore_lstro   rp   rc   Ú	arg_namesÚarg_defaultsÚarg_kwonlyargsÚarg_varargsÚ	arg_varkwÚparamÚclass_method_sigÚ	self_nameÚ_rW   Úarg_dictÚarg_positionÚarg_nameÚpositionÚeÚ	varkwargsÚ	arg_valueÚvarargsÚitems                           r(   Úfilter_argsr§   Ê   sº  € ô* �‹:€DÜ�*œcÔ"åâ(2´D¸Õ4DðFó
ð 	
ô
 ×Ñ˜DÔ!¬'×*<Ñ*<¸TÔ*BÙÜ�M‰MØFÈÑMØõð  Ñ(Ð(Ü×Ñ Ó%€GØ€IØ€LØ€NØ€KØ€IØ×#Ñ#×*Ñ*Ó,ó /ˆØ�:‰:˜×4Ñ4Ñ4Ø×Ñ˜UŸZ™ZÕ(Ø�Z‰Z˜5×-Ñ-Ñ-Ø×Ñ˜UŸZ™ZÔ(Ø×!Ñ! %§*¡*Õ-Ø�Z‰Z˜5×/Ñ/Ñ/ØŸ*™*‰KØ�Z‰Z˜5×,Ñ,Ñ,ØŸ
™
ˆIØ�=‰= §¡Ò+Ø×Ñ §¡Ö.ð/ô ×Ñ˜Ôð �M‰Mð
àñˆô #×,Ñ,¨T¯]©]Ó;ÐÜœÐ.×9Ñ9Ó:Ó;ˆ	Ø�K )Ñ+ˆ	ô ˜D¨uÔ5�G€A€tÜ‹v€HØ€LÜ"+¨IÓ"6ò !Ñˆ�hØœ#˜d›)Ò#à˜~Ñ-Ø%)¨,Ñ%7�˜Ò"å ò
 !Ü& t¨WÕ5Ü,¨T°4¸Õ@ðó	ð 	ð $¤c¨)£nÑ4ˆHØ˜6Ñ!Ø%+¨HÑ%5�˜Ò"ðØ)5°hÑ)?�H˜XÒ&ð/!ôF “€IÜ% f§l¡l£nÓ5ò 	Ñˆ�)Ø�xÑØ!*ˆH�XÒØÐ"Ø"+ˆI�hÒåâ+/²ð;óð ð	ð ÐØ"ˆ�‰ØÐØ�| aÑ'Ð)Ð*ˆØˆ�‰ð ò ˆØ�8ÑØ�L‰L˜Õåâ!%¤~°d¸GÔ'DðFóð ð	ð €OøôO #¤HÐ-ò 	å$ô +¨4°Õ9Ü0°°t¸VÕDð	óð ðûð	ús   Ê8MÍNÍ.(NÎNc                 óL   — t        | d¬«      }t        |«      dkD  rd|d d z  }|S )Nr?   )ÚindentiÜ  z%s...i¼  )r   rR   )ÚargÚformatted_args     r(   Ú_format_argr¬   T  s2   € Ü˜C¨Ô*€MÜ
ˆ=Ó˜DÒ Ø -°°Ð"5Ñ5ˆØÐr8   c                 óè  — t        | «      \  }}|D �cg c]  }|sŒ|‘Œ	 }}|r#|j                  |«       dj                  |«      }n|}t        «       }d}|D ]3  }	t	        |	«      }
|dkD  rd|
z  }
t        |
«      }|j                  |
«       Œ5 |j                  |j                  «       D ��cg c]  \  }}|›dt	        |«      ›�‘Œ c}}«       dj                  |«      }|›d|›d�}||fS c c}w c c}}w )	NrE   r   éP   z
%srh   rf   ú(ú))r_   rV   r   r   r¬   rR   rT   rn   )r    ro   rp   rZ   rW   ÚmÚmodule_pathÚarg_strÚprevious_lengthrª   r«   rl   Úir€   s                 r(   Úformat_signaturer¶   [  sî   € ä  Ó&�L€FˆDØÖ%�A¢1ŠaÐ%€FÐ%ÙØ�‰�dÔØ—h‘h˜vÓ&‰àˆÜ‹f€GØ€OØò &ˆÜ# CÓ(ˆØ˜RÒØ" ]Ñ2ˆMÜ˜mÓ,ˆØ�‰�}Õ%ð&ð ‡N�N¸f¿l¹l»n×M±d°a¸šq¤+¨a¤.Ò1ÓMÔNØ�i‰i˜Ó €Gâ ¢'Ð*€IØ˜	Ð!Ð!ùò% &ùó Ns   “C)›C)Â*C.
c                 óD   — t        | g|¢­i |¤Ž\  }}d›d|›d|›d|›�}|S )zdReturns a nicely formatted statement displaying the function
    call with the given arguments.
    ÚP________________________________________________________________________________z
[z
] Calling z...
)r¶   )r    ro   rp   Úobject_namer   r€   Úmsgs          r(   Úformat_callr»   s  s/   € ô ' tÐ=¨dÒ=°fÑ=�O€Dˆ)Ú*2²KÂÁyÐ
Q€CØ€Jr8   )TT)ÚMemory)Ú__doc__Úcollectionsr   r   r   r~   Ú	itertoolsr   Útokenizer   r   Úloggerr   Úfull_argspec_fieldsÚ
namedtupleÚfull_argspec_typer)   r7   r_   rd   rt   rŽ   r§   r¬   r¶   r»   ri   r8   r(   ú<module>rÅ      sƒ   ðñó Û Û 	Û 	Û Ý Ý +å ð Hð ð +�K×*Ñ*¨=Ð:MÓNÐ ò6/òró Wòt1ò
Dð (*±$³&ó GòTò"ô0r8   