
    &Vf
                     4    d Z ddlZdZdZ G d d          ZdS )z(Application-level experiment ID support.    N
experimentHTTP_TENSORBOARD_EXPERIMENT_IDc                       e Zd ZdZd Zd ZdS )ExperimentIdMiddlewarea6  WSGI middleware extracting experiment IDs from URL to environment.

    Any request whose path matches `/experiment/SOME_EID[/...]` will have
    its first two path components stripped, and its experiment ID stored
    onto the WSGI environment with key taken from the `WSGI_ENVIRON_KEY`
    constant. All other requests will have paths unchanged and the
    experiment ID set to the empty string. It noops if the key taken from
    the `WSGI_ENVIRON_KEY` is already present in the environment.

    Instances of this class are WSGI applications (see PEP 3333).
    c                 z    || _         t          j        dt          j        t                    z            | _        dS )zInitializes an `ExperimentIdMiddleware`.

        Args:
          application: The WSGI application to wrap (see PEP 3333).
        z/%s/([^/]*)N)_applicationrecompileescape_EXPERIMENT_PATH_COMPONENT_pat)selfapplications     ^/var/www/html/software/conda/lib/python3.11/site-packages/tensorboard/backend/experiment_id.py__init__zExperimentIdMiddleware.__init__*   s8     ( JRY'ABBB
 
			    c                    t           |v r|                     ||          S |                    dd          }| j                            |          }|rH|                    d          }||                    d          d          }|                    d          }nd}|}d}||t           <   ||d<   |                    dd          |z   |d<   |                     ||          S )N	PATH_INFO    r   SCRIPT_NAME)WSGI_ENVIRON_KEYr   getr   matchgroupend)r   environstart_responsepathmeidnew_pathroots           r   __call__zExperimentIdMiddleware.__call__7   s    w&&$$Wn==={{;++IOOD!! 	''!**CAEE!HHJJ'H771::DDCHD$' !'!(]B!?!?$!F  .999r   N)__name__
__module____qualname____doc__r   r$    r   r   r   r      s<        
 

 
 
: : : : :r   r   )r(   r	   r   r   r   r)   r   r   <module>r*      sZ    / . 
			
 *  4 ,: ,: ,: ,: ,: ,: ,: ,: ,: ,:r   