o
    xi                     @  st   U d dl mZ d dlZd dlmZ d dlmZmZ d dlm	Z	 d dl
mZ dZded< dddZG dd deZdS )    )annotationsN)urlsafe_b64encode)AnyFinal)crc32)ArtifactPLACEHOLDERz
Final[str]namestrreturnc                 C  s\   t dd|  }| kr| S t| dd@ }|jddd}t|dd	}| d
| S )z=Sanitize the string to satisfy constraints on artifact names.z[^a-zA-Z0-9_\-.]+ zutf-8l       big)	byteorder   =ascii-)resubr   encodeto_bytesr   rstripdecode)r	   	sanitizedcrc	crc_bytessuffix r   Z/home/ubuntu/.local/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 fddZ  ZS )InternalArtifacta  An Artifact intended for internal use only.

    Includes artifacts of type `job`, `code` (with a `source-` collection name
    prefix), `run_table` (with a `run-` collection name prefix), and any type that starts
    with `wandb-`. Users should not use this class directly.
    NFr	   r
   typedescription
str | Nonemetadatadict[str, Any] | Noneincrementalbooluse_asr   Nonec                   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)r	   r
   r!   r
   r"   r#   r$   r%   r&   r'   r(   r#   r   r)   )__name__
__module____qualname____doc__r+   __classcell__r   r   r/   r   r    !   s    r    )r	   r
   r   r
   )
__future__r   r   base64r   typingr   r   zlibr   wandb.sdk.artifacts.artifactr   r   __annotations__r   r    r   r   r   r   <module>   s    
