def split_option(cfg, sect, opt, ignore_sep=[], dtype=None):
    """Split values from configuration option value

    The program will use the "," separator first to split the data, if
    unseccessful it will use space.

    Parameters:
        cfg (str): Configuration parser
        sect (str): Section
        opt (str): Option
    Optional:
        ignore_sep (list): Ignore separator (use if "," is allowed in value)
        dtype (function): Map values to dtype
    """
    # Original value
    val = cfg.get(sect, opt)

    # Use coma first
    if ',' in val:
        vals = val.split(',')
    else:
        vals = val.split()

    # Map dtype
    if dtype is not None:
        vals = map(dtype, vals)
    
    return vals