
    h%                     ^    S r SSKr\R                  S:  a	  SrSrSrSrOSrSrS	rS
rS rS rg)zRobust apply mechanism

Provides a function "call", which can sort out
what arguments a given callable object can take,
and subset the given arguments to match only
those which are acceptable.
    Ni   __func____self____code__im_funcim_selfim_code	func_codec                    [        U S5      (       aJ  [        U R                  [        5      (       d  [        U R                  [        5      (       a  U R                  n [        U [        5      (       a!  U [	        [	        U [        5      [
        5      S4$ [        U [
        5      (       d  [        SU < S[        U 5      < 35      eU [	        U [
        5      S4$ )zGet function-like callable object for given receiver

returns (function_or_method, codeObject, fromMethod)

If fromMethod is true, then the callable already
has its first argument bound
__call__   zunknown reciever type  r   )hasattrr   r   r   getattrr	   
ValueErrortype)receivers    ]/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/pydispatch/robustapply.pyfunctionr      s     x$$H%%w//7H<M<Mw3W3W((H'##7!;YGJJh	**$x.QRRWXi0!33    c                    [        U 5      u  pnUR                  U[        U5      -   UR                   nUR                  XD[        U5      -     H  nXb;   d  M
  [	        SU< SU < 35      e   UR
                  S-  (       d6  [        UR                  5        VVs/ s H  u  pxXu;   d  M  Xx4PM     snn5      nU " U0 UD6$ s  snnf )zDCall receiver with arguments and an appropriate subset of named
    z	Argument z: specified both positionally and as a keyword for calling    )r   co_varnameslenco_argcount	TypeErrorco_flagsdictitems)	r   	argumentsnamed
codeObject
startIndex
acceptablenamekvs	            r   robustApplyr'   '   s     (0';$H*''
3y>(A*BXBXYJ&&zS^2KL=(  M !# u{{}H}eqe}HIY(%(( Is   B?
(B?
)	__doc__sys
hexversionr   r   r   r	   r   r'    r   r   <module>r,      sM    >>YGGGIGGGI4&)r   