o
    ½e¦iÝ  ã                   @   s   d Z ddd„ZdS )z>Utilities for hparams files

Authors
 * Artem Ploujnikov 2021
Nc                 C   s   |  | |¡S )a:  
    The equivalent of a "switch statement" for hparams files. The typical use case
    is where different options/modules are available, and a top-level flag decides
    which one to use

    Arguments
    ---------
    value: any
        the value to be used as a flag
    choices: dict
        a dictionary maps the possible values of the value parameter
        to the corresponding return values
    default: any
        the default value

    Returns
    -------
    The selected option out of the choices

    Example
    -------
    model: !new:speechbrain.lobes.models.g2p.model.TransformerG2P
        encoder_emb: !apply:speechbrain.utils.hparams.choice
            value: !ref <embedding_type>
            choices:
                regular: !ref <encoder_emb>
                normalized: !ref <encoder_emb_norm>
    )Úget)ÚvalueÚchoicesÚdefault© r   úW/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/speechbrain/utils/hparams.pyÚchoice   s   r   )N)Ú__doc__r   r   r   r   r   Ú<module>   s    