o
    wi                     @  sJ   d dl mZ d dlmZ d dlmZ d dlZddlmZ G dd dZ	dS )	    )annotations)Mapping)AnyN   )ipythonc                   @  s:   e Zd ZdddZdd ZddddZdd Zdd ZdS )AttrsattrsMapping[str, Any]c                 C  s   t || _d S N)dict_attrs)selfr    r   D/home/ubuntu/.local/lib/python3.10/site-packages/wandb/apis/attrs.py__init__   s   zAttrs.__init__c                 C  s2   d dd |dD }|d  |dd   S )N c                 S  s   g | ]}|  qS r   )title).0ir   r   r   
<listcomp>   s    z(Attrs.snake_to_camel.<locals>.<listcomp>_r      )joinsplitlower)r   stringcamelr   r   r   snake_to_camel   s   zAttrs.snake_to_camel  Freturnboolc                 C  s   t jr
t jjjr
dS t sdS | ||}|du r!t d dS zddlm	} W n t
y8   t d Y dS w |	|| dS )zDisplay this object in jupyter.FNz)This object does not support `.display()`r   )displayz-.display() only works in jupyter environmentsT)wandbrun	_settingssilentr   
in_jupyterto_htmltermwarnIPythonr!   ImportErrorHTML)r   heighthiddenhtmlr!   r   r   r   r!      s    

zAttrs.displayc                 O  s   d S r
   r   )r   argskwargsr   r   r   r'   )   s   zAttrs.to_htmlc                 C  sT   |  |}|dkrt|| jv r| j| S || jv r| j| S tt| d|)Nuserz object has no attribute )r   AttributeErrorr   repr)r   namekeyr   r   r   __getattr__,   s   




zAttrs.__getattr__N)r   r	   )r   F)r   r    )__name__
__module____qualname__r   r   r!   r'   r6   r   r   r   r   r      s    
r   )

__future__r   collections.abcr   typingr   r"   sdk.libr   r   r   r   r   r   <module>   s    