403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/referencing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/referencing/__pycache__/retrieval.cpython-314.pyc
+
(�i�
����Rt^RIHt^RIHt^RIHtHt^RIt^RI	H
t
^RIH
t
]'d^RIHtHtHt]
!R]R	7tR]P(]
P*3R
RlltR# ]d
^RIH
t
LRi;i)z2
Helpers related to (dynamic) resource retrieval.
)�annotations��	lru_cache)�
TYPE_CHECKING�CallableN)�TypeVar)�Resource)�URI�D�Retrieve�_T)�defaultc�(�V^8�dQhRRRRRRRR/#)	��cachez+Callable[[Retrieve[D]], Retrieve[D]] | None�loadszCallable[[_T], D]�
from_contentszCallable[[D], Resource[D]]�returnz,Callable[[Callable[[URI], _T]], Retrieve[D]]�)�formats"�7/usr/lib/python3/dist-packages/referencing/retrieval.py�__annotate__rs6��C�C�6�C��C�.�C�2�	C�c�Baaa�Sf
\RR7oRVVV3RllpV#)a�
Create a retriever which caches its return values from a simpler callable.

Takes a function which returns things like serialized JSON (strings) and
returns something suitable for passing to `Registry` as a retrieve
function.

This decorator both reduces a small bit of boilerplate for a common case
(deserializing JSON from strings and creating `Resource` objects from the
result) as well as makes the probable need for caching a bit easier.
Retrievers which otherwise do expensive operations (like hitting the
network) might otherwise be called repeatedly.

Examples
--------

.. testcode::

    from referencing import Registry
    from referencing.typing import URI
    import referencing.retrieval


    @referencing.retrieval.to_cached_resource()
    def retrieve(uri: URI):
        print(f"Retrieved {uri}")

        # Normally, go get some expensive JSON from the network, a file ...
        return '''
            {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "foo": "bar"
            }
        '''

    one = Registry(retrieve=retrieve).get_or_retrieve("urn:example:foo")
    print(one.value.contents["foo"])

    # Retrieving the same URI again reuses the same value (and thus doesn't
    # print another retrieval message here)
    two = Registry(retrieve=retrieve).get_or_retrieve("urn:example:foo")
    print(two.value.contents["foo"])

.. testoutput::

    Retrieved urn:example:foo
    bar
    bar

N)�maxsizec��V^8�dQhRR/#)r�retrievezCallable[[URI], _T]r)rs"rr�(to_cached_resource.<locals>.__annotate__Ss����/�rc�*<a�SRVVV3Rll4pV#)c��V^8�dQhRR/#)r�urir	r)rs"rr�;to_cached_resource.<locals>.decorator.<locals>.__annotate__Us��	+�	+��	+rc�4<�S!V4pS!V4pS!V4#)Nr)r �response�contentsrrrs&  ���r�cached_retrieve�>to_cached_resource.<locals>.decorator.<locals>.cached_retrieveTs �����}�H��X��H� ��*�*rr)rr%rrrsf ���r�	decorator�%to_cached_resource.<locals>.decoratorSs"���	�	+�	+�
�	+�
�rr)rrrr'sfff r�to_cached_resourcer)s'���n
�}��$�'�����r)�__doc__�
__future__r�	functoolsr�typingrr�json�typing_extensionsr�ImportError�referencingr�referencing.typingr	r
r�strrrrr)rrr�<module>r4sq���#��*���)�!��3�3�
�T�3���:>�#�z�z�08�0F�0F�C�C������s�A%�%
A5�4A5

Youez - 2016 - github.com/yon3zu
LinuXploit