U
    f»{jo  ã                   @   sf   d dl Z d dlmZ ddlmZ ddlmZmZmZm	Z	 dZ
dZdZe e¡Zeddd	œd
d„ƒZdS )é    Né   )Ú_manifest_check_downloadé   )ÚverboseÚget_subjects_dirÚ_check_optionÚ_validate_typez=2wk 1mo 2mo 3mo 4.5mo 6mo 7.5mo 9mo 10.5mo 12mo 15mo 18mo 2yrzehttps://github.com/christian-oreilly/infant_template_paper/releases/download/v0.1-alpha/{subject}.zipaÁ  
851737d5f8f246883f2aef9819c6ec29  ANTS10-5Months3T.zip
32ab6d025f4311433a82e81374f1a045  ANTS1-0Months3T.zip
48ef349e7cc542fdf63ff36d7958ab57  ANTS12-0Months3T.zip
bba22c95aa97988c6e8892d6169ed317  ANTS15-0Months3T.zip
e1bfe5e3ef380592822ced446a4008c7  ANTS18-0Months3T.zip
fa7bee6c0985b9cd15ba53820cd72ccd  ANTS2-0Months3T.zip
2ad90540cdf42837c09f8ce829458a35  ANTS2-0Weeks3T.zip
73e6a8b2579b7959a96f7d294ffb7393  ANTS2-0Years3T.zip
cb7b9752894e16a4938ddfe220f6286a  ANTS3-0Months3T.zip
16b2a6804c7d5443cfba2ad6f7d4ac6a  ANTS4-5Months3T.zip
dbdf2a9976121f2b106da96775690da3  ANTS6-0Months3T.zip
75fe37a1bc80ed6793a8abb47681d5ab  ANTS7-5Months3T.zip
790f7dba0a264262e6c1c2dfdf216215  ANTS9-0Months3T.zip
)r   c          	      C   sî   t | tdƒ td| t ¡ ƒ t|dd�}t |¡}tdddd�| dd	…  }| d	d…  d
¡d }d| krndnd}d|› |› |› d�}t 	||¡}t
j|dd� tdd„ t ¡  ¡ D ƒƒ}tt 	t|› d�¡|tj|d�||› d� d� |S )a¡  Fetch and update an infant MRI template.

    Parameters
    ----------
    age : str
        Age to download. Can be one of ``{'2wk', '1mo', '2mo', '3mo', '4.5mo',
        '6mo', '7.5mo', '9mo', '10.5mo', '12mo', '15mo', '18mo', '2yr'}``.
    subjects_dir : str | None
        The path to download the template data to.
    %(verbose)s

    Returns
    -------
    subject : str
        The standard subject name, e.g. ``ANTS4-5Month3T``.

    Notes
    -----
    If you use these templates in your work, please cite
    :footcite:`OReillyEtAl2021` and :footcite:`RichardsEtAl2016`.

    .. versionadded:: 0.23

    References
    ----------
    .. footbibliography::
    ÚageT)Zraise_errorZWeeksZMonthsZYears)ZwkÚmoÚyréþÿÿÿNÚ.r   z.5z-5z-0ZANTSZ3T)Úexist_okc                 s   s$   | ]}|  ¡  ¡ d d d… V  qd S )Néÿÿÿÿ)ÚstripÚsplit)Ú.0Úline© r   úX/var/www/html/bwave/python/venv/lib/python3.8/site-packages/mne/datasets/_infant/base.pyÚ	<genexpr>W   s   ÿz(fetch_infant_template.<locals>.<genexpr>z.txt)Úsubjectz.zip)Zmanifest_pathZdestinationÚurlÚhash_)r   Ústrr   Ú_AGESr   r   ÚopÚabspathÚdictÚjoinÚosÚmakedirsÚ_ORIGINAL_HASHESr   Ú
splitlinesr   Ú_MANIFEST_PATHÚ_ORIGINAL_URLÚformat)	r	   Zsubjects_dirr   ÚunitÚfirstÚdashr   Zsubj_dirZorig_hashesr   r   r   Úfetch_infant_template!   s(    *

ÿ
ür*   )N)r    Úos.pathÚpathr   Úutilsr   r   r   r   r   r   r%   r"   ÚdirnameÚ__file__r$   r*   r   r   r   r   Ú<module>   s   
