U
    nª/eÓ  ã                   @   s    d dl Z ddlmZ dd„ ZdS )é    Né   )Úcheckc                 C   s’   t  | › d¡}tj|d dd„ | ¡ D ƒ}g }|D ]V}| |d ¡}|d kr‚t j| › d|d|id}tj|d | ¡  d¡}| |¡ q6|S )Nz/api/v2/tag/)Úresponsec                 S   s   i | ]}|  d ¡|  d¡“qS )ÚnameÚid)Úget)Ú.0Úelm© r
   ú</tmp/pip-unpacked-wheel-t2z2wkof/dsmlibrary/utils/dataset.pyÚ
<dictcomp>   s      zget_tag_ids.<locals>.<dictcomp>r   )ÚheadersÚjsonr   )Úrequestsr   r   Zcheck_http_status_coder   ÚpostÚappend)Zbase_uriÚtagsÚheaderÚrZ	tag_metasZtag_idsÚtagZtag_idr
   r
   r   Úget_tag_ids   s"     ÿþr   )r   Ú r   r   r
   r
   r
   r   Ú<module>   s   