o
    -wi                     @   sd   U d dl Z d dlmZmZmZmZ d dlmZ dZee	 e
d< de	de	fddZG d	d
 d
eZdS )    N)AnyDictFinalOptional)ArtifactPLACEHOLDERnamereturnc                 C   sF   ddl m} tdd|  }| kr| S || d }| d| S )z=Sanitize the string to satisfy constraints on artifact names.r   )_md5z[^a-zA-Z0-9_\-.]+ zutf-8-)wandb.sdk.lib.hashutilr
   resubencode	hexdigest)r   r
   	sanitizedsuffix r   c/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/wandb/sdk/artifacts/_internal_artifact.pysanitize_artifact_name	   s
   r   c                       s\   e Zd ZdZ				ddededee deeeef  ded	ee d
df fddZ	  Z
S )InternalArtifactaK  InternalArtifact is used to create artifacts that are intended for internal use.

    This includes artifacts of type: `job`, `code`(with `source-` prefix in the collection name),
    `run_table` (with `run-` prefix in the collection name), and artifacts that start with `wandb-`.
    Users should not use this class directly.
    NFr   typedescriptionmetadataincrementaluse_asr	   c                    s(   t |}t |t|||| || _d S )N)r   super__init__r   _type)selfr   r   r   r   r   r   sanitized_name	__class__r   r   r      s
   	
zInternalArtifact.__init__)NNFN)__name__
__module____qualname____doc__strr   r   r   boolr   __classcell__r   r   r"   r   r      s*    r   )r   typingr   r   r   r   wandb.sdk.artifacts.artifactr   r   r(   __annotations__r   r   r   r   r   r   <module>   s   
 