def parse_setting_list(list_setting):
    """ This function parse ep list specified from setting file or cmd line

    Input list has following format [1, 5, 10-15] as a string or list of string
    and is expended as a single list [1, 5, 10, 11, 12, 13, 14, 15]

    Args:
        list_setting(str or list): the list from setting file or cmd line.

    Returns: A single list of ep
    """
    if isinstance(list_setting, str):
        list_setting = list_setting.replace('[', '')
        list_setting = list_setting.replace(']', '')
        list_setting = list_setting.split(',')
    single_list = []
    for ep in list_setting:
        if isinstance(ep, int):
            if ep < 0 or ep > 255:
                raise SyntaxError('EP out of bound')
            single_list.append(ep)
            continue
        try:
            ep = int(ep)
            if ep < 0 or ep > 255:
                raise SyntaxError('EP out of bound')
            single_list.append(ep)
            continue
        except ValueError:
            pass
        try:
            ep = ep.replace("'", '')
            lower, upper = ep.split('-')
            lower = int(lower)
            upper = int(upper)
            if lower > upper or lower < 0 or upper > 255:
                raise SyntaxError('Wrong EP range value')
            single_list += list(range(lower, upper + 1))
        except (AttributeError, ValueError):
            raise SyntaxError('Wrong EP range format')
    return single_list
