o
    xi1                     @  s  d Z ddlmZ ddlZddlmZ ddlZddlmZ ddl	m
Z
 ddlmZ G dd	 d	ejZe dRddZejedddejdSddZe ejddejddddejdddddedddTdUd#dZe dRd$d%Ze ejd&ejddd'd(ejd)ddd*d+ejd,d-dd.d/ejd0d1dd2d/ejd3d4dd5d/ejd6dd7d/ejd8dd9d/ejd:ddd;d+ejd<ddd=d+ejd>d?ddd@d+ejdAdBdCd/dVdPdQZdS )WzwBeta versions of wandb CLI commands.

These commands are experimental and may change or be removed in future versions.
    )annotationsN)Any)
get_sentry)WandbCoreNotAvailableError)get_core_pathc                      s@   e Zd ZdZddd fddZd fddZdddZ  ZS )DefaultCommandGroupa   A click Group that falls through to a default command.

    If the first argument isn't a recognized subcommand, the default
    command is invoked with all arguments passed through. This allows
    backward-compatible CLIs where `cmd [path]` and `cmd run [path]`
    are equivalent.
    run)default_cmdargsr   r	   strkwargsreturnNonec                  s   t  j|i | || _d S )N)super__init__r	   )selfr	   r
   r   	__class__ B/home/ubuntu/.local/lib/python3.10/site-packages/wandb/cli/beta.pyr      s   
zDefaultCommandGroup.__init__ctxclick.Context	list[str]c                   s:   |r|d  ds|d | jvr| jg|}t ||S )Nr   -)
startswithcommandsr	   r   
parse_args)r   r   r
   r   r   r   r      s    zDefaultCommandGroup.parse_args	formatterclick.HelpFormatterc                 C  s   | |jd d S )Nz[PATH] | COMMAND [ARGS]...)write_usagecommand_path)r   r   r   r   r   r   format_usage$   s   z DefaultCommandGroup.format_usage)r
   r   r	   r   r   r   r   r   )r   r   r
   r   r   r   )r   r   r   r   r   r   )__name__
__module____qualname____doc__r   r   r!   __classcell__r   r   r   r   r      s
    r   r   r   c               
   C  sd   t  jdd zt  W dS  ty1 }  zt  d|   tj| ddd W Y d} ~ dS d} ~ ww )zzBeta versions of wandb CLI commands.

    These commands may change or even completely break in any release of wandb.
    
wandb_beta)process_contextz using `wandb beta`. failed with redT)fgerrN)r   configure_scoper   r   	exceptionclicksecho)er   r   r   beta(   s   r1   r   T)clsr	   invoke_without_commandr   r   c                 C  s   dS )zW&B LEET: the Lightweight Experiment Exploration Tool.

    A terminal UI for viewing your W&B runs locally.

    Examples:
        wandb beta leet                 View latest run
        wandb beta leet ./wandb         View runs in directory
    Nr   )r   r   r   r   leet;   s   r4   path   )existsF)nargstyperequiredz--pprof z;Serve /debug/pprof/* on this address (e.g. 127.0.0.1:6060).)defaulthiddenhelpz-hz--help
str | Nonepprofr   c                 C  s   ddl m} || | dS )zLaunch the LEET TUI.

    PATH can be a .wandb file, a run directory, or a wandb directory.
    If omitted, searches for the latest run.
    r6   	beta_leetN)r;   rB   launch)r5   r@   rB   r   r   r   r   I   s   c                  C  s   ddl m}  |   dS )zEdit LEET configuration.r6   rA   N)r;   rB   launch_configrA   r   r   r   config]   s   rE   paths)r9   r8   z--livezvSync a run while it's still being logged.

    This may hang if the process generating the run crashes uncleanly.
    )is_flagr<   r>   z-ez--entityz4An entity override to use for all runs being synced.)r<   r>   z-pz	--projectz4A project override to use for all runs being synced.z--idrun_ida  A run ID override to use for all runs being synced.

    If setting this and syncing multiple files (with the same entity
    and project), the files will be synced in order of start time.
    This is intended to work with syncing multiple resumed fragments
    of the same run.
    z
--job-typez.A job type override for all runs being synced.z--replace-tagsz3Rename tags using the format 'old1=new1,old2=new2'.z--skip-synced/--no-skip-syncedz:Skip runs that have already been synced with this command.z	--dry-runz3Print what would happen without uploading anything.z-vz	--verbosezPrint more information.z-n   a  Max number of runs to sync at a time.

    When syncing multiple files that are part of the same run,
    the files are synced sequentially in order of start time
    regardless of this setting. This happens for resumed runs
    or when using the --id parameter.
    tuple[str, ...]liveboolentityprojectjob_typereplace_tagsskip_synceddry_runverbosenintc                 C  s:   ddl m} |jdd | D |||||||||	|
d dS )a  Upload .wandb files specified by PATHS.

    This is a beta re-implementation of `wandb sync`.
    It is not feature complete, not guaranteed to work, and may change
    in backward-incompatible ways in any release of wandb.

    PATHS can include .wandb files, run directories containing .wandb files,
    and "wandb" directories containing run directories.

    For example, to sync all runs in a directory:

        wandb beta sync ./wandb

    To sync a specific run:

        wandb beta sync ./wandb/run-20250813_124246-n67z9ude

    Or equivalently:

        wandb beta sync ./wandb/run-20250813_124246-n67z9ude/run-n67z9ude.wandb
    r6   )	beta_syncc                 S  s   g | ]}t |qS r   )pathlibPath).0r5   r   r   r   
<listcomp>   s    zsync.<locals>.<listcomp>)
rL   rN   rO   rI   rP   rQ   rS   rR   rT   parallelismN)r;   rW   sync)rF   rL   rN   rO   rI   rP   rQ   rR   rS   rT   rU   rW   r   r   r   r]   e   s   m
r]   )r   r   )r   r   r   r   )Nr;   )r5   r?   r@   r   r   r   )rF   rK   rL   rM   rN   r   rO   r   rI   r   rP   r   rQ   r   rR   rM   rS   rM   rT   rM   rU   rV   r   r   )r%   
__future__r   rX   typingr   r.   wandb.analyticsr   wandb.errorsr   
wandb.utilr   Groupr   groupr1   pass_contextr4   commandargumentrY   optionhelp_optionr   rE   r]   r   r   r   r   <module>   s    
	&