def parse_token(bn,token):
    """
    Obtains the value associated with the given within the basename.

    Parameters
    ----------
    bn: string, expected.
        The basename fo the file.
    token: string, expected.
        The token to be parsed.

    Returns
    -------
        The value associated with the token.

    Example
    -------
        bn = str1val1_str2val2_str3val3.ext
        tokens = [str1,str2,str3]
        values = [parse_token(bn,token) for token in tokens]
        values will be [val1,val2,val3]
    """
    return bn.split(token)[1].split('_')[0]