o
    wi                     @  s`   d dl mZ d dlmZmZ d dlmZ ddd	ZdddZddddZ	dddZ
dddZdS )    )annotations)	b64decode	b64encode)Anysstrprefixreturnc                 C  s   |  |r| S | |  S )z2Ensures the string has the given prefix prepended.)
startswith)r   r    r   C/home/ubuntu/.local/lib/python3.10/site-packages/wandb/_strutils.pyensureprefix      r   suffixc                 C  s   |  |r| S |  | S )z1Ensures the string has the given suffix appended.)endswith)r   r   r   r   r   ensuresuffix   r   r   Tobjr   fullboolc                 C  s   |r	t | d| jS | jS )zInternal convenience helper that returns the object's `__name__` or `__qualname__`.

    If `full` is True, attempt to return the object's `__qualname__` attribute,
    falling back on the `__name__` attribute.
    __qualname__)getattr__name__)r   r   r   r   r   nameof   s   r   c                 C  s   t | dS )z|Returns the decoded base64 string interpreted as ASCII.

    Convenience function for directly converting `str -> str`.
    ascii)r   decoder   r   r   r   b64decode_ascii   s   r   c                 C  s   t | ddS )z}Returns the base64 encoding of the string's ASCII bytes.

    Convenience function for directly converting `str -> str`.
    r   )r   encoder   r   r   r   r   b64encode_ascii"   s   r   N)r   r   r   r   r	   r   )r   r   r   r   r	   r   )T)r   r   r   r   r	   r   )r   r   r	   r   )
__future__r   base64r   r   typingr   r   r   r   r   r   r   r   r   r   <module>   s    


	