§
    9P„jY  ã                   ó@   — d Z ddlmZ dZ G d„ d¦  «        Zd„ Zd„ ZdS )	zRequest-scoped context.é    )Úauthztensorboard.request_contextc                   ó€   — e Zd ZdZ	 	 	 	 d	d„Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Z	d„ Z
dS )
ÚRequestContexta  Container of request-scoped values.

    This context is for cross-cutting concerns: authentication,
    authorization, auditing, internationalization, logging, and so on.
    It is not simply for passing commonly used parameters to functions.

    `RequestContext` values are to be treated as immutable.

    Fields:
      auth: An `AuthContext`, which may be empty but is never `None`.
      remote_ip: An `ipaddress.IPv4Address` or `ipaddress.IPv6Address` or None.
        Best guess of the IP Address of the end user.
      x_forwarded_for: A tuple of `ipaddress.IPv4Address` or `ipaddress.IPv6Address`,
        which may be empty but is never None. This should be parsed value of X-Forwarded-For
        HTTP header from the request.
      client_feature_flags: A dict of string to arbitrary type. These represent
        feature flag key/value pairs sent by the client application. Usage of
        client_feature_flags should know the name of the feature flag key and
        should know and validate the type of the value.
    Nc                 ó†   — |�|nt           j                             ¦   «         | _        || _        |pd| _        |pi | _        dS )aY  Create a request context.

        The argument list is sorted and may be extended in the future;
        therefore, callers must pass only named arguments to this
        initializer.

        Args:
          See "Fields" on class docstring. All arguments are optional
          and will be replaced with default values if appropriate.
        N© )Úauth_libÚAuthContextÚemptyÚ_authÚ
_remote_ipÚ_x_forwarded_forÚ_client_feature_flags)Úselfr   Ú	remote_ipÚx_forwarded_forÚclient_feature_flagss        úX/root/disk_3tb/conda_envs/Huy-visual/lib/python3.11/site-packages/tensorboard/context.pyÚ__init__zRequestContext.__init__.   sJ   € ð" "Ð-�T�Tµ8Ô3G×3MÒ3MÑ3OÔ3OˆŒ
Ø#ˆŒØ /Ð 5°2ˆÔØ%9Ð%?¸RˆÔ"Ð"Ð"ó    c                 ó   — | j         S ©N)r   ©r   s    r   r   zRequestContext.authD   s
   € àŒzÐr   c                 ó   — | j         S r   )r   r   s    r   r   zRequestContext.remote_ipH   s
   € àŒÐr   c                 ó   — | j         S r   )r   r   s    r   r   zRequestContext.x_forwarded_forL   s   € àÔ$Ð$r   c                 ó   — | j         S r   )r   r   s    r   r   z#RequestContext.client_feature_flagsP   s   € àÔ)Ð)r   c                 ó  — |                      d| j        ¦  «         |                      d| j        ¦  «         |                      d| j        ¦  «         |                      d| j        ¦  «          t          | ¦  «        di |¤ŽS )ay  Create a copy of this context with updated key-value pairs.

        Analogous to `namedtuple._replace`. For example, to create a new
        request context like `ctx` but with auth context `auth`, call
        `ctx.replace(auth=auth)`.

        Args:
          As to `__init__`.

        Returns:
          A new context like this one but with the specified updates.
        r   r   r   r   r   )Ú
setdefaultr   r   r   r   Útype)r   Úkwargss     r   ÚreplacezRequestContext.replaceT   s„   € ð 	×Ò˜& $¤)Ñ,Ô,Ð,Ø×Ò˜+ t¤~Ñ6Ô6Ð6Ø×ÒÐ+¨TÔ-AÑBÔBÐBØ×ÒÐ0°$Ô2KÑLÔLÐLØ�t�D‰zŒzÐ#Ð#˜FÐ#Ð#Ð#r   )NNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r   r   r   r    r   r   r   r   r      s¿   € € € € € ðð ð. ØØØ!ð@ð @ð @ð @ð, ðð ñ „Xðð ðð ñ „Xðð ð%ð %ñ „Xð%ð ð*ð *ñ „Xð*ð$ð $ð $ð $ð $r   r   c                 óZ   — |                       t          ¦  «        }|�|nt          ¦   «         S )a  Get a `RequestContext` from a WSGI environment.

    See also `set_in_environ`.

    Args:
      environ: A WSGI environment (see PEP 3333).

    Returns:
      The `RequestContext` stored in the WSGI environment, or an empty
      `RequestContext` if none is stored.
    )ÚgetÚ	_WSGI_KEYr   )ÚenvironÚresults     r   Úfrom_environr+   h   s*   € ð �[Š[�Ñ#Ô#€FØÐ'ˆ6ˆ6­^Ñ-=Ô-=Ð=r   c                 ó   — || t           <   dS )zúSet the `RequestContext` in a WSGI environment.

    After `set_in_environ(e, ctx)`, `from_environ(e) is ctx`. The input
    environment is mutated.

    Args:
      environ: A WSGI environment to update.
      ctx: A new `RequestContext` value.
    N)r(   )r)   Úctxs     r   Úset_in_environr.   x   s   € ð €G�IÑÐÐr   N)r$   Útensorboardr   r   r(   r   r+   r.   r   r   r   ú<module>r0      s   ðð Ð à (Ð (Ð (Ð (Ð (Ð (ð *€	ðM$ð M$ð M$ð M$ð M$ñ M$ô M$ð M$ð`>ð >ð >ð 
ð 
ð 
ð 
ð 
r   