
    &Vf
                     0    d Z ddlmZ  G d d          ZdS )zInternal path prefix support for TensorBoard.

Using a path prefix of `/foo/bar` enables TensorBoard to serve from
`http://localhost:6006/foo/bar/` rather than `http://localhost:6006/`.
See the `--path_prefix` flag docs for more details.
    )errorsc                       e Zd ZdZd Zd ZdS )PathPrefixMiddlewareaX  WSGI middleware for path prefixes.

    All requests to this middleware must begin with the specified path
    prefix (otherwise, a 404 will be returned immediately). Requests
    will be forwarded to the underlying application with the path prefix
    stripped and appended to `SCRIPT_NAME` (see the WSGI spec, PEP 3333,
    for details).
    c                     |                     d          rt          d|z            |r'|                    d          st          d|z            || _        || _        | j        dz   | _        dS )ax  Initializes this middleware.

        Args:
          application: The WSGI application to wrap (see PEP 3333).
          path_prefix: A string path prefix to be stripped from incoming
            requests. If empty, this middleware is a no-op. If non-empty,
            the path prefix must start with a slash and not end with one
            (e.g., "/tensorboard").
        /z'Path prefix must not end with slash: %rz/Non-empty path prefix must start with slash: %rN)endswith
ValueError
startswith_application_path_prefix_strict_prefix)selfapplicationpath_prefixs      \/var/www/html/software/conda/lib/python3.11/site-packages/tensorboard/backend/path_prefix.py__init__zPathPrefixMiddleware.__init__$   s     $$ 	9KG    	{55c:: 	AKO   ('"/#5    c                 J   |                     dd          }|| j        k    r-|                    | j                  st	          j                    |t          | j                  d          |d<   |                     dd          | j        z   |d<   |                     ||          S )N	PATH_INFO SCRIPT_NAME)getr   r
   r   r   NotFoundErrorlenr   )r   environstart_responsepaths       r   __call__zPathPrefixMiddleware.__call__:   s    {{;++4$$$T__.
 .
$ &(((#C(9$:$:$<$<=KKr**T->> 	   .999r   N)__name__
__module____qualname____doc__r   r    r   r   r   r      s<         6 6 6,
: 
: 
: 
: 
:r   r   N)r"   tensorboardr   r   r#   r   r   <module>r%      sU          *: *: *: *: *: *: *: *: *: *:r   