
    @g                          d Z ddlZdZdZ	 d Zy)z=Simple function decorators to make Python programming easier.    N)RESULTS_ATTRIBUTEcachedcached_resultsc                 F     t        j                          fd       S )a  
    Rudimentary caching decorator for functions.

    :param function: The function whose return value should be cached.
    :returns: The decorated function.

    The given function will only be called once, the first time the wrapper
    function is called. The return value is cached by the wrapper function as
    an attribute of the given function and returned on each subsequent call.

    .. note:: Currently no function arguments are supported because only a
              single return value can be cached. Accepting any function
              arguments at all would imply that the cache is parametrized on
              function arguments, which is not currently the case.
    c                  x    	 t        t              S # t        $ r         } t        t        |        | cY S w xY w)N)getattrr   AttributeErrorsetattr)resultfunctionwrappers    M/var/www/openai/venv/lib/python3.12/site-packages/humanfriendly/decorators.pyr   zcached.<locals>.wrapper#   s>    	7$566 	ZFG.7M	s    #99)	functoolswraps)r   r   s   `@r   r   r      s'      __X  N    )__doc__r   __all__r   r    r   r   <module>r      s%    D  *$  Wr   