o
    /wi                     @  s6   d dl mZ d dlZd dlZd dlmZ dddZdS )    )annotationsN)ArtifactStoreartifact_storer   	file_pathstrartifact_idreturnNonec              	   C  s   t j|rtd| | |,}t|d}t|| W d   n1 s)w   Y  W d   dS W d   dS 1 sAw   Y  dS )a  Download an artifact from the artifact store.

    Args:
        artifact_store:
            An artifact store.
        file_path:
            A path to save the downloaded artifact.
        artifact_id:
            The identifier of the artifact to download.
    zFile already exists: wbN)ospathexistsFileExistsErroropen_readeropenshutilcopyfileobj)r   r   r   readerwriter r   W/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/optuna/artifacts/_download.pydownload_artifact	   s
   Pr   )r   r   r   r   r   r   r   r	   )
__future__r   r   r   optuna.artifacts._protocolr   r   r   r   r   r   <module>   s
    