Ë
    ¨ehç5  ã                   óÄ   — 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ZddlmZm	Z	m
Z
mZmZmZmZmZmZ  G d„ d«      Zd„ Zdd	œd
„Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Zd„ Zdd„Zy)a+  
Helper functions for managing the Matplotlib API.

This documentation is only relevant for Matplotlib developers, not for users.

.. warning::

    This module and its submodules are for internal use only.  Do not use them
    in your own code.  We may change the API at any time with no warning.

é    Né   )	Ú
deprecatedÚwarn_deprecatedÚrename_parameterÚdelete_parameterÚmake_keyword_onlyÚdeprecate_method_overrideÚdeprecate_privatize_attributeÚ'suppress_matplotlib_deprecation_warningÚMatplotlibDeprecationWarningc                   ó.   — e Zd ZdZdd„Zd„ Zed„ «       Zy)Úclasspropertya$  
    Like `property`, but also triggers on access via the class, and it is the
    *class* that's passed as argument.

    Examples
    --------
    ::

        class C:
            @classproperty
            def foo(cls):
                return cls.__name__

        assert C.foo == "C"
    Nc                 óZ   — || _         |€|�t        d«      ‚|| _        || _        || _        y )Nz#classproperty only implements fget.)Ú_fgetÚ
ValueErrorÚfsetÚfdelÚ_doc)ÚselfÚfgetr   r   Údocs        úV/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/matplotlib/_api/__init__.pyÚ__init__zclassproperty.__init__-   s5   € ØˆŒ
ØÐ˜tÐ/ÜÐBÓCÐCØˆŒ	ØˆŒ	àˆ�	ó    c                 ó$   — | j                  |«      S ©N©r   )r   ÚinstanceÚowners      r   Ú__get__zclassproperty.__get__6   s   € Ø�z‰z˜%Ó Ð r   c                 ó   — | j                   S r   r   )r   s    r   r   zclassproperty.fget9   s   € à�z‰zÐr   )NNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r    Úpropertyr   © r   r   r   r      s%   „ ñó ò!ð ñó ñr   r   c                óà  ‡— t        d«      Št        | t         «      r| fn| €‰fnt        ˆfd„| D «       «      } ˆfd„}|j                  «       D ]ž  \  }}t        || «      rŒg t	        || «      ¢}d|v r"|j                  d«       |j                  d«       t        dj                  |t        |«      dkD  rdj                  |dd «      d	z   |d   z   n|d
    |t        |«      «      «      «      ‚ y)a3  
    For each *key, value* pair in *kwargs*, check that *value* is an instance
    of one of *types*; if not, raise an appropriate TypeError.

    As a special case, a ``None`` entry in *types* is treated as NoneType.

    Examples
    --------
    >>> _api.check_isinstance((SomeClass, None), arg=arg)
    Nc              3   ó*   •K  — | ]
  }|€‰n|–— Œ y ­wr   r'   )Ú.0ÚtpÚ	none_types     €r   ú	<genexpr>z#check_isinstance.<locals>.<genexpr>O   s   øè ø€ ÒC°r  
‘9°Ó2ÑCùs   ƒc                 ó|   •— | ‰u rdS | j                   dk(  r| j                  S | j                   › d| j                  › �S )NÚNoneÚbuiltinsú.)r#   r$   )r+   r,   s    €r   Ú	type_namez#check_isinstance.<locals>.type_nameQ   sD   ø€ Ø 	™/�ð 	;Ø(*¯©¸Ò(C�R—_‘_ð	;àŸ™� a¨¯©Ð'8Ð9ð	;r   r/   z({!r} must be an instance of {}, not a {}r   ú, éÿÿÿÿz or r   )ÚtypeÚ
isinstanceÚtupleÚitemsÚmapÚremoveÚappendÚ	TypeErrorÚformatÚlenÚjoin)ÚtypesÚkwargsr2   ÚkÚvÚnamesr,   s         @r   Úcheck_isinstancerE   A   sð   ø€ ô �T“
€IÜ# E¬4Ô0ˆe‰XØ"˜]ˆi‰\ÜÓC¸UÔCÓCð 
ô;ð
 —‘“ò )‰ˆˆ1Ü˜!˜UÕ#Ø,”c˜) UÓ+Ð,ˆEØ˜‰Ø—‘˜VÔ$Ø—‘˜VÔ$ÜØ:×AÑAØä˜5“z A’~ð —I‘I˜e C R˜jÓ)¨FÑ2°U¸2±YÒ>Ø+0°©8Ùœd 1›gÓ&ó	(ó)ð )ñ)r   T)Ú_print_supported_valuesc         	      óÈ   — |st        d«      ‚|j                  «       D ]B  \  }}|| vsŒ|›d|› �}|r%|ddj                  t        t        | «      «      › �z  }t        |«      ‚ y)ak  
    For each *key, value* pair in *kwargs*, check that *value* is in *values*;
    if not, raise an appropriate ValueError.

    Parameters
    ----------
    values : iterable
        Sequence of values to check on.
    _print_supported_values : bool, default: True
        Whether to print *values* when raising ValueError.
    **kwargs : dict
        *key, value* pairs as keyword arguments to find in *values*.

    Raises
    ------
    ValueError
        If any *value* in *kwargs* is not found in *values*.

    Examples
    --------
    >>> _api.check_in_list(["foo", "bar"], arg=arg, other_arg=other_arg)
    zNo argument to check!ú is not a valid value for ú; supported values are r3   N)r<   r8   r?   r9   Úreprr   )ÚvaluesrF   rA   ÚkeyÚvalÚmsgs         r   Úcheck_in_listrO   d   su   € ñ. ÜÐ/Ó0Ð0Ø—L‘L“Nò "‰ˆˆSØ�fÒØ�GÐ5°c°UÐ;ˆCÙ&ØÐ0°·±¼3¼tÀVÓ;LÓ1MÐ0NÐOÑO�Ü˜S“/Ð!ñ"r   c          
      ó&  — |j                  «       D ]ù  \  }}|j                  }t        |«      t        | «      k7  st        d„ t	        || «      D «       «      sŒFt        t        j                  dd„ t        j                  «       D «       «      «      }dj                  | ddd…   D �cg c]  }|�t        |«      n
t        |«      ‘Œ c}ddd…   «      }t        | «      dk(  r|dz  }t        |›d	t        | «      › d
|› d|j                  › �«      ‚ yc c}w )a¦  
    For each *key, value* pair in *kwargs*, check that *value* has the shape *shape*;
    if not, raise an appropriate ValueError.

    *None* in the shape is treated as a "free" size that can have any length.
    e.g. (None, 2) -> (N, 2)

    The values checked must be numpy arrays.

    Examples
    --------
    To check for (N, 2) shaped arrays

    >>> _api.check_shape((None, 2), arg=arg, other_arg=other_arg)
    c              3   ó8   K  — | ]  \  }}||k7  xr |d u–— Œ y ­wr   r'   )r*   ÚsÚts      r   r-   zcheck_shape.<locals>.<genexpr>™   s$   è ø€ ÒS±D°A°q�q˜A‘vÒ/ !¨4 -Ó/ÑSùs   ‚ÚNMLKJIHc              3   ó&   K  — | ]	  }d |› �–— Œ y­w)ÚDNr'   )r*   Úis     r   r-   zcheck_shape.<locals>.<genexpr>œ   s   è ø€ Ò4˜Q�1�Q�C”Ñ4ùs   ‚r3   Nr4   r   ú,z	 must be zD with shape (z), but your input has shape )r8   Úshaper>   ÚanyÚzipÚiterÚ	itertoolsÚchainÚcountr?   ÚstrÚnextr   )rY   rA   rB   rC   Ú
data_shapeÚ
dim_labelsÚnÚ
text_shapes           r   Úcheck_shaperf   …   s  € ð  —‘“ò ‰ˆˆ1Ø—W‘Wˆ
ä�
‹Oœs 5›zÒ)ÜÑS¼CÀ
ÈEÓ<RÔSÕSÜœiŸo™oØÙ4¤)§/¡/Ó"3Ô4ó6ó 7ˆJð Ÿ™Ø-2±4°R°4©[ö$:Ø()ð /0¨m¤C¨¤FÄÀjÓAQÑ$Qò $:Ù:>¸B¸$ñ$@ó AˆJä�5‹z˜QŠØ˜cÑ!�
äØ�%�y¤ U£ ¨N¸:¸,ð G,Ø,-¯G©G¨9ð6óð ñùò$:s   Â$D
c                óæ   — t        |«      dk7  rt        d«      ‚|j                  «       \  \  }}	 | |   S # t        $ r2 t        |›d|› ddj	                  t        t        | «      «      › �«      d‚w xY w)zò
    *kwargs* must consist of a single *key, value* pair.  If *key* is in
    *mapping*, return ``mapping[value]``; else, raise an appropriate
    ValueError.

    Examples
    --------
    >>> _api.check_getitem({"foo": "bar"}, arg=arg)
    r   z-check_getitem takes a single keyword argumentrH   rI   r3   N)r>   r   r8   ÚKeyErrorr?   r9   rJ   )ÚmappingrA   rB   rC   s       r   Úcheck_getitemrj   ¨   s…   € ô ˆ6ƒ{�aÒÜÐHÓIÐIØ�l‰l‹n�G�F€Qˆð:Ø�q‰zÐøÜò :ÜØˆeÐ-¨a¨SÐ0GØ�y‰yœœT 7Ó+Ó,Ð-ð/ó0à59ð	:ð:ús	   °5 µ;A0c                 óö   ‡ ‡‡— ‰ j                   dk(  sJ ‚t        ‰ «      j                  «       D ��ci c]  \  }}t        |t        «      r||“Œ c}}Š ‰ «       Št
        j                  ˆ ˆˆfd„«       }|S c c}}w )a
  
    Helper decorator for implementing module-level ``__getattr__`` as a class.

    This decorator must be used at the module toplevel as follows::

        @caching_module_getattr
        class __getattr__:  # The class *must* be named ``__getattr__``.
            @property  # Only properties are taken into account.
            def name(self): ...

    The ``__getattr__`` class will be replaced by a ``__getattr__``
    function such that trying to access ``name`` on the module will
    resolve the corresponding property (which may be decorated e.g. with
    ``_api.deprecated`` for deprecating module globals).  The properties are
    all implicitly cached.  Moreover, a suitable AttributeError is generated
    and raised if no property with the given name exists.
    Ú__getattr__c                 ój   •— | ‰v r‰|    j                  ‰«      S t        d‰j                  ›d| ›�«      ‚)Nzmodule z has no attribute )r    ÚAttributeErrorr#   )ÚnameÚclsr   Úpropss    €€€r   rl   z+caching_module_getattr.<locals>.__getattr__Ö   sD   ø€ à�5‰=Ø˜‘;×&Ñ& xÓ0Ð0ÜØ�c—n‘nÐ'Ð'9¸$¸ÐBóDð 	Dr   )r"   Úvarsr8   r6   r&   Ú	functoolsÚcache)rp   ro   Úproprl   r   rq   s   `   @@r   Úcaching_module_getattrrv   ½   sw   ú€ ð& �<‰<˜=Ò(Ð(Ð(ä*.¨s«)¯/©/Ó*;÷ ,™J˜D $Ü˜4¤Ô*ð �4‰Zó ,€Eá‹u€Hä‡_�_õDó ðDð Ðùó,s   ±A5c                 ó¾  ‡— ‰€t        j                  t        | «      S ˆfd„}| j                  «       D ]k  \  }}d}dD ]O  }||z   t	        ‰«      v sŒd}|D ]5  } |||z   «      }||z   |_        d||z   › d�|_        t        ‰||z   |«       Œ7 ŒQ |rŒ_t        d|›�«      ‚ d„ }	t        ‰d	i «      }
 |	|
«       |	| «      z  }|rt        d
|› �«      ‚i |
¥| ¥‰_        ‰S )aT  
    Class decorator for defining property aliases.

    Use as ::

        @_api.define_aliases({"property": ["alias", ...], ...})
        class C: ...

    For each property, if the corresponding ``get_property`` is defined in the
    class so far, an alias named ``get_alias`` will be defined; the same will
    be done for setters.  If neither the getter nor the setter exists, an
    exception will be raised.

    The alias map is stored as the ``_alias_map`` attribute on the class and
    can be used by `.normalize_kwargs` (which assumes that higher priority
    aliases come last).
    c                 óX   •‡ — t        j                  t        ‰‰ «      «      ˆ fd„«       }|S )Nc                 ó(   •—  t        | ‰«      |i |¤ŽS r   )Úgetattr)r   ÚargsrA   ro   s      €r   Úmethodz2define_aliases.<locals>.make_alias.<locals>.methodö   s   ø€ à&”7˜4 Ó&¨Ð7°Ñ7Ð7r   )rs   Úwrapsrz   )ro   r|   rp   s   ` €r   Ú
make_aliasz"define_aliases.<locals>.make_aliasõ   s*   ù€ Ü	�‰œ  dÓ+Ó	,ó	8ó 
-ð	8àˆr   F)Úget_Úset_TzAlias for `z`.z%Neither getter nor setter exists for c                 ó8   — h | £d„ | j                  «       D «       £S )Nc              3   ó.   K  — | ]  }|D ]  }|–— Œ Œ y ­wr   r'   )r*   ÚaliasesÚaliass      r   r-   zBdefine_aliases.<locals>.get_aliased_and_aliases.<locals>.<genexpr>
  s   è ø€ ÒK À7ÒK¸%”eÐK�eÑKùs   ‚)rK   )Úds    r   Úget_aliased_and_aliasesz/define_aliases.<locals>.get_aliased_and_aliases	  s   € ØL�ÐLÑK¨1¯8©8«:ÔKÐLÐLr   Ú
_alias_mapz2Parent class already defines conflicting aliases: )rs   ÚpartialÚdefine_aliasesr8   rr   r"   r%   Úsetattrr   rz   ÚNotImplementedErrorr‡   )Úalias_drp   r~   ru   rƒ   ÚexistsÚprefixr„   r|   r†   Úpreexisting_aliasesÚconflictings    `          r   r‰   r‰   à   s4  ø€ ð$ €{Ü× Ñ ¤°Ó9Ð9ôð !Ÿ™›ò B‰ˆˆgØˆØ&ò 	9ˆFØ˜‰}¤ S£	Ò)Ø�Ø$ò 9�EÙ'¨°©Ó6�FØ&,¨u¡n�F”OØ'2°6¸D±=°/ÀÐ%D�F”NÜ˜C ¨%¡°Õ8ñ	9ð	9ò ÜØ7¸°xÐ@óBð BðBòMô " # |°RÓ8ÐÙ*Ð+>Ó?Ù,¨WÓ5ñ6€Káä!Ø@ÀÀÐNóPð 	Pà7Ð+Ð7¨wÐ7€C„NØ€Jr   c                 ó€   — t        | «      D ]  \  }}	  ||i |¤Žc S  y# t        $ r |t        | «      dz
  k(  r‚ Y Œ0w xY w)a  
    Select and call the function that accepts ``*args, **kwargs``.

    *funcs* is a list of functions which should not raise any exception (other
    than `TypeError` if the arguments passed do not match their signature).

    `select_matching_signature` tries to call each of the functions in *funcs*
    with ``*args, **kwargs`` (in the order in which they are given).  Calls
    that fail with a `TypeError` are silently skipped.  As soon as a call
    succeeds, `select_matching_signature` returns its return value.  If no
    function accepts ``*args, **kwargs``, then the `TypeError` raised by the
    last failing call is re-raised.

    Callers should normally make sure that any ``*args, **kwargs`` can only
    bind a single *func* (to avoid any ambiguity), although this is not checked
    by `select_matching_signature`.

    Notes
    -----
    `select_matching_signature` is intended to help implementing
    signature-overloaded functions.  In general, such functions should be
    avoided, except for back-compatibility concerns.  A typical use pattern is
    ::

        def my_func(*args, **kwargs):
            params = select_matching_signature(
                [lambda old1, old2: locals(), lambda new: locals()],
                *args, **kwargs)
            if "old1" in params:
                warn_deprecated(...)
                old1, old2 = params.values()  # note that locals() is ordered.
            else:
                new, = params.values()
            # do things with params

    which allows *my_func* to be called either with two parameters (*old1* and
    *old2*) or a single one (*new*).  Note that the new signature is given
    last, so that callers get a `TypeError` corresponding to the new signature
    if the arguments they passed in do not match any signature.
    r   N)Ú	enumerater<   r>   )Úfuncsr{   rA   rW   Úfuncs        r   Úselect_matching_signaturer•     s[   € ôX ˜UÓ#ò ‰ˆˆ4ð	Ù˜Ð( Ñ(Ò(ñøô ò 	Ø”C˜“J ‘NÒ"Øñ #ð	ús   “Ÿ=¼=c                 ó*   — t        | › d|› d|› d�«      S )zEGenerate a TypeError to be raised by function calls with wrong arity.z	() takes z positional arguments but z were given)r<   )ro   ÚtakesÚgivens      r   Únargs_errorr™   K  s(   € ä˜�v˜Y u gÐ-GØ�w˜kð+ó ,ð ,r   c                 ól   — t        |t        «      st        t        |«      «      }t	        | › d|› d�«      S )aL  
    Generate a TypeError to be raised by function calls with wrong kwarg.

    Parameters
    ----------
    name : str
        The name of the calling function.
    kw : str or Iterable[str]
        Either the invalid keyword argument name, or an iterable yielding
        invalid keyword arguments (e.g., a ``kwargs`` dict).
    z'() got an unexpected keyword argument 'ú')r6   r`   ra   r\   r<   )ro   Úkws     r   Úkwarg_errorr�   Q  s4   € ô �bœ#ÔÜ”$�r“(‹^ˆÜ˜�vÐDÀRÀDÈÐJÓKÐKr   c              #   óh   K  — | –— | j                  «       D ]  }t        |«      E d{  –—†  Œ y7 Œ­w)z8Yield *cls* and direct and indirect subclasses of *cls*.N)Ú__subclasses__Úrecursive_subclasses)rp   Úsubclss     r   r    r    b  s4   è ø€ à
‚IØ×$Ñ$Ó&ò 0ˆÜ'¨Ó/×/Ñ/ñ0Ø/ús   ‚&2¨0©2c                 óä  — i }t         j                  dd dk\  rFt        j                  t        «      j
                  d   }t        |dz  «      t        |dz  «      f|d<   n{t        j                  «       }t        j                  d«      D ]N  }|€||d<    nEt        j                  d	|j                  j                  d
d«      «      s||d<    n|j                  }ŒP ~t        j                   | |fi |¤Ž y)a4  
    `warnings.warn` wrapper that sets *stacklevel* to "outside Matplotlib".

    The original emitter of the warning can be obtained by patching this
    function back to `warnings.warn`, i.e. ``_api.warn_external =
    warnings.warn`` (or ``functools.partial(warnings.warn, stacklevel=2)``,
    etc.).
    Né   )é   é   Ú
matplotlibÚmpl_toolkitsÚskip_file_prefixesr   Ú
stacklevelz-\A(matplotlib|mpl_toolkits)(\Z|\.(?!tests\.))r"   Ú )ÚsysÚversion_infoÚpathlibÚPathÚ__file__Úparentsr`   Ú	_getframer]   r_   ÚreÚmatchÚ	f_globalsÚgetÚf_backÚwarningsÚwarn)ÚmessageÚcategoryrA   ÚbasedirÚframer©   s         r   Úwarn_externalr½   i  sê   € ð €FÜ
×Ñ˜˜Ð˜wÒ&ä—,‘,œxÓ(×0Ñ0°Ñ3ˆÜ(+¨G°lÑ,BÓ(CÜ(+¨G°nÑ,DÓ(Eð(GˆÐ#Ò$ô —‘“ˆÜ#Ÿ/™/¨!Ó,ò 
	!ˆJØˆ}à'1��|Ñ$ÙÜ—8‘8ÐLà!ŸO™O×/Ñ/°
¸BÓ?ôAð (2��|Ñ$ÙØ—L‘L‰Eð
	!ð Ü‡M�M�'˜8Ñ. vÓ.r   r   )r%   rs   r]   r­   r²   r«   r·   Údeprecationr   r   r   r   r   r	   r
   r   r   r   rE   rO   rf   rj   rv   r‰   r•   r™   r�   r    r½   r'   r   r   ú<module>r¿      s{   ðñ
ó Û Û Û 	Û 
Û ÷"÷ "õ "÷ñ òJ )ðF 9=ô "òB òF:ò* óF4òn1òh,òLò"0ô/r   