import re


def parse_config_str(config_str: str):
    """

    Args:
        config_str (str): [description]

    ### Examples:
        >>> input_1: 'rand-re0.25'
        >>> output_1: {'rand': True, 're': 0.25}

        >>> input_2: 'baseline'
        >>> output_2: {'baseline': True}
    """
    configs = dict()
    for kv_pair in config_str.split('-'):
        result = re.split(r'(\d.*)', kv_pair)
        if len(result) == 1:
            k = result[0]
            configs[k] = True
        else:
            assert len(result) == 3 and result[2] == ''
            k, v, _ = re.split(r'(\d.*)', kv_pair)
            configs[k] = float(v)
    return configs