def _choose_metric_function(key: str):
    """
    Auxiliary function for choosing a metric

    Args:
        key (str): Key word for choosing a metrics

    Returns:
        function: implementation of the desired metrics
    """
    out = lambda x: x

    if key == 'mean':
        out = lambda x: x.mean()

    elif key == 'median':
        out = lambda x: x.median()

    elif key == 'sharpe':
        out = lambda x: x.mean()/x.std()

    elif key == 'q1':
        out = lambda x: x.quantile(q=.25)

    elif key == 'q3':
        out = lambda x: x.quantile(q=.75)

    elif key == 'p10':
        out = lambda x: x.quantile(q=.10)

    elif key == 'p90':
        out = lambda x: x.quantile(q=.90)

    return out