o
    ni                     @   s   d Z ddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZmZmZ ddlmZ ddlZddlmZmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlm Z  ddl!m"Z"m#Z#m$Z$ ddl%m&Z& erxddl'm(Z( ddhZ)dZ*G dd deZ+G dd deZ,dS )zPublic API: runs.    N)TYPE_CHECKINGAny
CollectionDictListLiteralMappingOptional)gql)envutil)public)Attrs)Api)normalize_exceptions)	Paginator)RETRY_TIMEDELTA)ipython	json_utilrunid)LogicalPath)RetryingClient_wandbwandb_versionaJ  fragment RunFragment on Run {
    id
    tags
    name
    displayName
    sweepName
    state
    config
    group
    jobType
    commit
    readOnly
    createdAt
    heartbeatAt
    description
    notes
    systemMetrics
    summaryMetrics
    historyLineCount
    user {
        name
        username
    }
    historyKeys
}c                       s   e Zd ZdZedeZ				d&ddded	ed
e	e
eef  de	e dedef fddZedd Zedd Zedd Zdd Ze					d'dede	ee  deded d ed! f
d"d#Zd$d% Z  ZS )(RunszAn iterable collection of runs associated with a project and optional filter.

    This is generally used indirectly via the `Api`.runs method.
    a  
        query Runs($project: String!, $entity: String!, $cursor: String, $perPage: Int = 50, $order: String, $filters: JSONString) {{
            project(name: $project, entityName: $entity) {{
                internalId
                runCount(filters: $filters)
                readOnly
                runs(filters: $filters, after: $cursor, first: $perPage, order: $order) {{
                    edges {{
                        node {{
                            ...RunFragment
                        }}
                        cursor
                    }}
                    pageInfo {{
                        endCursor
                        hasNextPage
                    }}
                }}
            }}
        }}
        {}
        N2   Tclientr   entityprojectfiltersorderper_pageinclude_sweepsc           	         s^   || _ || _d | _|pi | _|| _i | _|| _| j| j | jt| jd}t	 
||| d S )N)r   r   r    r   )r   r   _project_internal_idr   r    _sweeps_include_sweepsjsondumpssuper__init__)	selfr   r   r   r   r    r!   r"   	variables	__class__ T/home/ubuntu/SoloSpeech/.venv/lib/python3.10/site-packages/wandb/apis/public/runs.pyr)   _   s   


zRuns.__init__c                 C   s   | j r
| j d d S d S )Nr   runCountlast_responser*   r.   r.   r/   lengthx   s   zRuns.lengthc                 C   s    | j r| j d d d d S dS )Nr   runspageInfohasNextPageTr1   r3   r.   r.   r/   more   s   z	Runs.morec                 C   s$   | j r| j d d d d d S d S )Nr   r5   edgescursorr1   r3   r.   r.   r/   r;      s   zRuns.cursorc              	   C   s   g }| j d u s| j dd u rtd| j| j d d d D ]K}t| j| j| j|d d |d | jd}|	| | jrk|j
rk|j
| jv rN| j|j
 }ntjj| j| j| j|j
dd	}|| j|j
< |d u rhq ||_q |S )
Nr   zCould not find project {}r5   r9   nodename)r"   FwithRuns)r2   get
ValueErrorformatr   Runr   r   r%   append
sweep_namer$   r   Sweepsweep)r*   objsrun_responserunrG   r.   r.   r/   convert_objects   s:   

zRuns.convert_objects  _stepdefaultsampleskeysx_axisrB   rN   pandaspolarsstream)rN   systemc                 C   s  |dvrt d| dg }|dkr5| D ]}|j|||d|d}|s#q|D ]}	|j|	d< q%|| q|S |dkr}tjdd	d
}
| D ]}|j|||d|d}|sQqB|
j|}|j|d< || qB|sh|
 S |
	|}|j
ddd |t|j }|S |dkrtjddd
}| D ]%}|j|||d|d}|sq||}|||jd}|| q|s| S |j	|dd}|t|j}|S dS )al  Return sampled history metrics for all runs that fit the filters conditions.

        Args:
            samples : (int, optional) The number of samples to return per run
            keys : (list[str], optional) Only return metrics for specific keys
            x_axis : (str, optional) Use this metric as the xAxis defaults to _step
            format : (Literal, optional) Format to return data in, options are "default", "pandas", "polars"
            stream : (Literal, optional) "default" for metrics, "system" for machine metrics
        Returns:
            pandas.DataFrame: If format="pandas", returns a `pandas.DataFrame` of history metrics.
            polars.DataFrame: If format="polars", returns a `polars.DataFrame` of history metrics.
            list of dicts: If format="default", returns a list of dicts containing history metrics with a run_id key.
        rR   zInvalid format: z.. Must be one of 'default', 'pandas', 'polars'rN   F)rO   rP   rQ   rS   rU   run_idrS   z*Exporting pandas DataFrame requires pandas)requiredT)dropinplacerT   z*Exporting polars DataFrame requires polarsvertical)howN)rA   historyidextendr   
get_module	DataFramefrom_recordsrD   concatreset_indexsortedcolumnswith_columnslitaliasselect)r*   rO   rP   rQ   rB   rU   	historiesrJ   history_dataentrypddfcombined_dfplr.   r.   r/   rk      s   



zRuns.historiesc                 C   s   d| j  d| j dS )Nz<Runs />r   r   r3   r.   r.   r/   __repr__     zRuns.__repr__)NNr   T)rL   NrM   rN   rN   )__name__
__module____qualname____doc__r
   rB   RUN_FRAGMENTQUERYstrr	   r   r   intboolr)   propertyr4   r8   r;   rK   r   r   r   rk   ru   __classcell__r.   r.   r,   r/   r   @   sd    


"
`r   c                       s<  e Zd ZdZ		dbdddededed	ee d
ef fddZe	dd Z
e	dd Ze	dd Ze	dd Ze	dd Zejdd Ze	dd Zejdd ZedcddZddddZed d! Zed"d# Zeddd$d%Zd&d' Ze	d(d) Zd*d+ Zded.d/Zdfd1d2Zedgd4d5Zed6d7 Zedhd9d:Ze	0did;d<Z edjd>d?Z!edkdAe"dBe#j$fdCdDZ%edkdAe"dBe#j$fdEdFZ&edldGdHZ'e		dmdIdJdKee(e  dLee(e  fdMdNZ)edBefdOdPZ*e	dQdR Z+e	dSdT Z,e	dUdV Z-e	dWdX Z.e	dYdZ Z/dnd\d]Z0dBefd^d_Z1d`da Z2  Z3S )orC   aI  A single run associated with an entity and project.

    Attributes:
        tags ([str]): a list of tags associated with the run
        url (str): the url of this run
        id (str): unique identifier for the run (defaults to eight characters)
        name (str): the name of the run
        state (str): one of: running, finished, crashed, killed, preempting, preempted
        config (dict): a dict of hyperparameters associated with the run
        created_at (str): ISO timestamp when the run was started
        system_metrics (dict): the latest system metrics recorded for the run
        summary (dict): A mutable dict-like property that holds the current summary.
                    Calling update will persist any changes.
        project (str): the project associated with the run
        entity (str): the name of the entity associated with the run
        project_internal_id (int): the internal id of the project
        user (str): the name of the user who created the run
        path (str): Unique identifier [entity]/[project]/[run_id]
        notes (str): Notes about the run
        read_only (boolean): Whether the run is editable
        history_keys (str): Keys of the history metrics that have been logged
            with `wandb.log({key: value})`
        metadata (str): Metadata about the run from wandb-metadata.json
    NTr   r   r   r   rW   attrsr"   c                    s   |pi }t  t| || _|| _|| _i | _tt	
 | _|| _d| _|| _tjj| jg| jR  | _zt| j W n	 tyG   Y nw d| _d| _|dd| _d| _| j| d dS )zInitialize a Run object.

        Run is always initialized by calling api.runs() where api is an instance of
        wandb.Api.
        Nstatez	not found)force)r(   r)   dictr   _entityr   _filesr   get_dirtempfile
gettempdir	_base_dirr^   rG   r%   ospathjoindirmakedirsOSError_summary	_metadatar@   _state!server_provides_internal_id_fieldload)r*   r   r   r   rW   r   r"   _attrsr,   r.   r/   r)   .  s*   zRun.__init__c                 C      | j S N)r   r3   r.   r.   r/   r   R     z	Run.statec                 C   r   r   )r   r3   r.   r.   r/   r   V  r   z
Run.entityc                 C   s   t d | jS )Nz:Run.username is deprecated. Please use Run.entity instead.)wandbtermwarnr   r3   r.   r.   r/   usernameZ  s   
zRun.usernamec                 C      | j dS )Nr^   r   r@   r3   r.   r.   r/   
storage_id_  s   zRun.storage_idc                 C   r   Nr=   r   r3   r.   r.   r/   r^   f     zRun.idc                 C   s   | j }||d< |S r   r   )r*   new_idr   r.   r.   r/   r^   j  s   c                 C   r   NdisplayNamer   r3   r.   r.   r/   r=   p  r   zRun.namec                 C   s   || j d< |S r   r   )r*   new_namer.   r.   r/   r=   t  s   
c                 C   s   |pt  }|p|jdpd}td}|||d}|jj||d}|d d }t|j|d d d	 |d d	 |d	 |d
 dddg ddddS )z#Create a run for the given project.r   uncategorizeda  
        mutation UpsertBucket($project: String, $entity: String, $name: String!) {
            upsertBucket(input: {modelName: $project, entityName: $entity, name: $name}) {
                bucket {
                    project {
                        name
                        entity { name }
                    }
                    id
                    name
                }
                inserted
            }
        }
        r   r   r=   variable_valuesupsertBucketbucketr   r=   r^   {}Nrunning)r^   configsystemMetricssummaryMetricstagsdescriptionnotesr   )r   generate_idsettingsr@   r
   r   executerC   )clsapirW   r   r   mutationr+   resr.   r.   r/   createy  s.   
z
Run.createFc           	      C   s  t d|  r	dndt}|s| jsb| |}|d u s,|dd u s,|d dd u r3td| |d d | _| jd | _|d dd | _	| j
rb| jrb| jsbtjj| j| j| j| jdd	| _z| jd
rqt| jd
 ni | jd
< W n tjjy   tj| jd
 dd| jd
< Y nw | jdrt| jd ni | jd< | jdrt| j| jd | _i i }}t| jdpd D ] \}}|tv r|n|}t|trd|v r|d ||< q|||< q|| || jd< || jd< | jS )Na!  
        query Run($project: String!, $entity: String!, $name: String!) {{
            project(name: $project, entityName: $entity) {{
                {}
                run(name: $name) {{
                    ...RunFragment
                }}
            }}
        }}
        {}
        
internalId r   rJ   zCould not find run {}r   Fr>   r   )strictr   userr   r   value	rawconfig)r
   rB   (_server_provides_internal_id_for_projectr{   r   _execr@   rA   r   r#   r%   rE   rG   r   rF   r   r   r   r&   loadsdecoderJSONDecodeErrorUserr   itemsWANDB_INTERNAL_KEYS
isinstancer   update)	r*   r   queryresponseconfig_user
config_rawkeyr   r   r.   r.   r/   r     sf   





"



zRun.loadc                 C   sL   t d}	 | |}|d d d }|dv r || jd< || _d S td q)Na  
            query RunState($project: String!, $entity: String!, $name: String!) {
                project(name: $project, entityName: $entity) {
                    run(name: $name) {
                        state
                    }
                }
            }
        Tr   rJ   r   )finishedcrashedfailed   )r
   r   r   r   timesleep)r*   r   r   r   r.   r.   r/   wait_until_finished  s   


zRun.wait_until_finishedc                 C   sH   t dt}| j|| j| j| j| j| j| j	| j
| jd	}| j  dS )z7Persist changes to the run object to the wandb backend.a  
        mutation UpsertBucket($id: String!, $description: String, $display_name: String, $notes: String, $tags: [String!], $config: JSONString!, $groupName: String, $jobType: String) {{
            upsertBucket(input: {{id: $id, description: $description, displayName: $display_name, notes: $notes, tags: $tags, config: $config, groupName: $groupName, jobType: $jobType}}) {{
                bucket {{
                    ...RunFragment
                }}
            }}
        }}
        {}
        )r^   r   r   r   display_namer   	groupNamejobTypeN)r
   rB   r{   r   r   r   r   r   r   json_configgroupjob_typesummaryr   )r*   r   _r.   r.   r/   r      s    	z
Run.updatec                 C   s<   t d|rdnd|rdnd}| jj|| j|dd dS )z,Delete the given run from the wandb backend.a  
            mutation DeleteRun(
                $id: ID!,
                {}
            ) {{
                deleteRun(input: {{
                    id: $id,
                    {}
                }}) {{
                    clientMutationId
                }}
            }}
        z$deleteArtifacts: Booleanr   z!deleteArtifacts: $deleteArtifacts)r^   deleteArtifactsr   N)r
   rB   r   r   r   )r*   delete_artifactsr   r.   r.   r/   delete  s   


z
Run.deletec                 C   s   |    d S r   )r   r3   r.   r.   r/   save:  s   zRun.savec                 C   sN   i }d| j v r| j d d d|d< | j D ]\}}|d d||< qt|S )Nr   )r   desc)r   r   r   r&   r'   )r*   r   kvr.   r.   r/   r   =  s   

zRun.json_configc                 K   s,   | j | j| jd}|| | jj||dS )z*Execute a query against the cloud backend.r   r   )r   r   r^   r   r   r   )r*   r   kwargsr+   r.   r.   r/   r   F  s   
z	Run._execrM   rL   c                 C   sB   |g| |d}t d}| j|t|gd}|d d d d S )N)rP   rO   a  
        query RunSampledHistory($project: String!, $entity: String!, $name: String!, $specs: [JSONString!]!) {
            project(name: $project, entityName: $entity) {
                run(name: $name) { sampledHistory(specs: $specs) }
            }
        }
        )specsr   rJ   sampledHistoryr   )r
   r   r&   r'   )r*   rP   rQ   rO   specr   r   r.   r.   r/   _sampled_historyL  s   
zRun._sampled_historyrN   c                 C   sF   |dkrdnd}t d|}| j||d}dd |d d	 | D S )
NrN   r]   eventsa   
        query RunFullHistory($project: String!, $entity: String!, $name: String!, $samples: Int) {{
            project(name: $project, entityName: $entity) {{
                run(name: $name) {{ {}(samples: $samples) }}
            }}
        }}
        )rO   c                 S   s   g | ]}t |qS r.   )r&   r   ).0liner.   r.   r/   
<listcomp>i  s    z%Run._full_history.<locals>.<listcomp>r   rJ   )r
   rB   r   )r*   rO   rU   r<   r   r   r.   r.   r/   _full_history\  s   
zRun._full_historyr   c                 C   s   t | j| |pg |S )a$  Return a file path for each file named.

        Args:
            names (list): names of the requested files, if empty returns all files
            per_page (int): number of results per page.

        Returns:
            A `Files` object, which is an iterator over `File` objects.
        r   Filesr   )r*   namesr!   r.   r.   r/   filesk  s   z	Run.filesc                 C   s   t | j| |gd S )zReturn the path of a file with a given name in the artifact.

        Args:
            name (str): name of requested file.

        Returns:
            A `File` matching the name argument.
        r   r   )r*   r=   r.   r.   r/   filex  s   
zRun.file.c                 C   s   t | j| jdtd}|| j tj|}tj	||}t
tj||d}|t||i W d   n1 s<w   Y  t| j| |gd S )a  Upload a file.

        Args:
            path (str): name of file to upload.
            root (str): the root path to save the file relative to.  i.e.
                If you want to have the file saved in the run as "my_dir/file.txt"
                and you're currently in "my_dir" you would set root to "../".

        Returns:
            A `File` matching the name argument.
        rt   default_settingsretry_timedeltarbNr   )InternalApir   r   r   set_current_run_idr^   r   r   abspathrelpathopenr   pushr   r   r   r   )r*   r   rootr   r=   fr.   r.   r/   upload_file  s   zRun.upload_filec                 C   s   |durt |tstd g S |dur(t|dkr(t |d ts(td g S |r5|dkr5td g S |r@| j|||d}n| j||d}|r\t	d	}|rX|j
|}|S td
 |S )a  Return sampled history metrics for a run.

        This is simpler and faster if you are ok with the history records being sampled.

        Args:
            samples : (int, optional) The number of samples to return
            pandas : (bool, optional) Return a pandas dataframe
            keys : (list, optional) Only return metrics for specific keys
            x_axis : (str, optional) Use this metric as the xAxis defaults to _step
            stream : (str, optional) "default" for metrics, "system" for machine metrics

        Returns:
            pandas.DataFrame: If pandas=True returns a `pandas.DataFrame` of history
                metrics.
            list of dicts: If pandas=False returns a list of dicts of history metrics.
        N keys must be specified in a listr   'keys argument must be a list of stringsrN   z+stream must be default when specifying keys)rP   rQ   rO   )rO   rU   rS   z5Unable to load pandas, call history with pandas=False)r   listr   	termerrorlenr}   r   r   r   r`   ra   rb   print)r*   rO   rP   rQ   rS   rU   linesrn   r.   r.   r/   r]     s&   
"


zRun.history  c                 C   s   |durt |tstd g S |dur(t|dkr(t |d ts(td g S | j}|du r1d}|du r9|d }||krA|d }|du rPtj| | j	|||dS tj
| | j	||||dS )a.  Returns an iterable collection of all history records for a run.

        Example:
            Export all the loss values for an example run

            ```python
            run = api.run("l2k2/examples-numpy-boston/i0wt6xua")
            history = run.scan_history(keys=["Loss"])
            losses = [row["Loss"] for row in history]
            ```

        Args:
            keys ([str], optional): only fetch these keys, and only fetch rows that have all of keys defined.
            page_size (int, optional): size of pages to fetch from the api.
            min_step (int, optional): the minimum number of pages to scan at a time.
            max_step (int, optional): the maximum number of pages to scan at a time.

        Returns:
            An iterable collection over history records (dict).
        Nr  r   r     )rJ   r   	page_sizemin_stepmax_step)rJ   r   rP   r  r  r  )r   r  r   r	  r
  r}   lastHistoryStepr   HistoryScanr   SampledHistoryScan)r*   rP   r  r  r  	last_stepr.   r.   r/   scan_history  s:   
"
zRun.scan_historyd   r!   returnc                 C      t j| j| d|dS )a  Fetches all artifacts logged by this run.

        Retrieves all output artifacts that were logged during the run. Returns a
        paginated result that can be iterated over or collected into a single list.

        Args:
            per_page: Number of artifacts to fetch per API request.

        Returns:
            An iterable collection of all Artifact objects logged as outputs during this run.

        Example:
            >>> import wandb
            >>> import tempfile
            >>> with tempfile.NamedTemporaryFile(
            ...     mode="w", delete=False, suffix=".txt"
            ... ) as tmp:
            ...     tmp.write("This is a test artifact")
            ...     tmp_path = tmp.name
            >>> run = wandb.init(project="artifact-example")
            >>> artifact = wandb.Artifact("test_artifact", type="dataset")
            >>> artifact.add_file(tmp_path)
            >>> run.log_artifact(artifact)
            >>> run.finish()
            >>> api = wandb.Api()
            >>> finished_run = api.run(f"{run.entity}/{run.project}/{run.id}")
            >>> for logged_artifact in finished_run.logged_artifacts():
            ...     print(logged_artifact.name)
            test_artifact
        loggedmoder!   r   RunArtifactsr   r*   r!   r.   r.   r/   logged_artifacts  s    zRun.logged_artifactsc                 C   r  )a  Fetches artifacts explicitly used by this run.

        Retrieves only the input artifacts that were explicitly declared as used
        during the run, typically via `run.use_artifact()`. Returns a paginated
        result that can be iterated over or collected into a single list.

        Args:
            per_page: Number of artifacts to fetch per API request.

        Returns:
            An iterable collection of Artifact objects explicitly used as inputs in this run.

        Example:
            >>> import wandb
            >>> run = wandb.init(project="artifact-example")
            >>> run.use_artifact("test_artifact:latest")
            >>> run.finish()
            >>> api = wandb.Api()
            >>> finished_run = api.run(f"{run.entity}/{run.project}/{run.id}")
            >>> for used_artifact in finished_run.used_artifacts():
            ...     print(used_artifact.name)
            test_artifact
        usedr  r  r  r.   r.   r/   used_artifacts   s   zRun.used_artifactsc                 C   st   t | j| jdtd}|| j t|tjr(|	 s(|j
|j|p#|jd |S t|tjr6|	 r6tdtd)a  Declare an artifact as an input to a run.

        Args:
            artifact (`Artifact`): An artifact returned from
                `wandb.Api().artifact(name)`
            use_as (string, optional): A string identifying
                how the artifact is used in the script. Used
                to easily differentiate artifacts used in a
                run, when using the beta wandb launch
                feature's artifact swapping functionality.

        Returns:
            A `Artifact` object.
        rt   r   )use_as_Only existing artifacts are accepted by this api. Manually create one with `wandb artifact put`6You must pass a wandb.Api().artifact() to use_artifact)r   r   r   r   r   r^   r   r   Artifactis_draftuse_artifactr=   rA   )r*   artifactr#  r   r.   r.   r/   r(  ;  s   zRun.use_artifactr)  zwandb.Artifactaliasesr   c                 C   s   t | j| jdtd}|| j t|tjst	d|
 r#t	d| j|jks/| j|jkr3t	d|jdd }|j|j||j||d |S )	aq  Declare an artifact as output of a run.

        Args:
            artifact (`Artifact`): An artifact returned from
                `wandb.Api().artifact(name)`.
            aliases (list, optional): Aliases to apply to this artifact.
            tags: (list, optional) Tags to apply to this artifact, if any.

        Returns:
            A `Artifact` object.
        rt   r   r%  r$  z3A run can't log an artifact to a different project.:r   )r*  r   )r   r   r   r   r   r^   r   r   r&  rA   r'  source_entitysource_projectsource_namesplitcreate_artifacttypedigest)r*   r)  r*  r   r   artifact_collection_namer.   r.   r/   log_artifact\  s.   zRun.log_artifactc                 C   sv   d}| j du r8t|}| j|}tddd |di di gD v  ddd |di di gD v | _ | j S )	zReturns True if the server allows us to query the internalId field for a project.

        This check is done by utilizing GraphQL introspection in the avaiable fields on the Project type.
        z
           query ProbeProjectInput {
                ProjectType: __type(name:"Project") {
                    fields {
                        name
                    }
                }
            }
        Nr   c                 S      g | ]}|d  qS r=   r.   r   xr.   r.   r/   r     s    z@Run._server_provides_internal_id_for_project.<locals>.<listcomp>ProjectTypefieldsc                 S   r5  r6  r.   r7  r.   r.   r/   r     s    )r   r
   r   r   r  r@   )r*   query_stringr   r   r.   r.   r/   r     s   

z,Run._server_provides_internal_id_for_projectc                 C   s0   | j d u rddlm} || | j| jd| _ | j S )Nr   )HTTPSummary)r   )r   wandb.old.summaryr<  r   summary_metrics)r*   r<  r.   r.   r/   r     s   
zRun.summaryc                 C   s4   t jt| jt jt| jt jt| jgS r   )urllibparse
quote_plusr}   r   r   r^   r3   r.   r.   r/   r     s   zRun.pathc                 C   s$   | j }|dd | jjd| S )N   r5   rr   )r   insertr   app_urlr   )r*   r   r.   r.   r/   url  s   zRun.urlc                 C   sh   | j d u r1z$| d}| jjjj}|j|jdd}|  |j	}t
|| _ W | j S    Y | j S | j S )Nzwandb-metadata.jsonr   )timeout)r   r   r   _client	transportsessionr@   rE  raise_for_statuscontentr   r   )r*   r  rI  r   contentsr.   r.   r/   metadata  s   

zRun.metadatac                 C   sx   t d}| |}|d u s(|dd u s(|d dd u s(|d d dd u r*dS |d d d }d|v r:|d S dS )Nz
        query RunHistoryKeys($project: String!, $entity: String!, $name: String!) {
            project(name: $project, entityName: $entity) {
                run(name: $name) { historyKeys }
            }
        }
        r   rJ   historyKeysr:   lastStep)r
   r   r@   )r*   r   r   history_keysr.   r.   r/   r    s   
	zRun.lastHistoryStep  c                 C   sD   | j d }d| d}d}|r|d7 }t }|d|d|d S )	z7Generate HTML containing an iframe displaying this run.z?jupyter=truezborder:none;width:100%;height:zpx;r   zdisplay:none;z<iframe src=z style=z
></iframe>)rE  r   toggle_button)r*   heighthiddenrE  styleprefixr.   r.   r/   to_html  s   
zRun.to_htmlc                 C   s   |   S r   )rW  r3   r.   r.   r/   _repr_html_  s   zRun._repr_html_c                 C   s   d d| j| jS )Nz<Run {} ({})>rr   )rB   r   r   r   r3   r.   r.   r/   ru     rv   zRun.__repr__)NT)NNN)F)rM   rL   )rL   rN   )Nr   )r   )rL   NrM   TrN   )Nr  NN)r  r   )NN)rQ  F)4rw   rx   ry   rz   r}   r	   r   r   r)   r   r   r   r   r   r^   setterr=   classmethodr   r   r   r   r   r   r   r   r   r   r   r   r   r  r]   r  r~   r   r  r   r"  r(  r   r4  r   r   r   rE  rM  r  rW  rX  ru   r   r.   r.   r,   r/   rC     s    $








)G





)7! 

.






rC   )-rz   r&   r   r   r   r?  typingr   r   r   r   r   r   r   r	   	wandb_gqlr
   r   r   r   
wandb.apisr   wandb.apis.attrsr   wandb.apis.internalr   r   wandb.apis.normalizer   wandb.apis.paginatorr   wandb.apis.public.constr   wandb.sdk.libr   r   r   wandb.sdk.lib.pathsr   wandb.apis.publicr   r   r{   r   rC   r.   r.   r.   r/   <module>   s2    ( U