def _parse_categorical(line):
    if ('#' in line):
        comment_begins = line.find('#')
        line = line[:comment_begins]
    if ((line.count('{') != 1) or (line.count('}') != 1)):
        raise ValueError(('Malformed parameter line %s' % line))
    first_bracket = line.find('{')
    second_bracket = line.find('}')
    domain_values = line[(first_bracket + 1):second_bracket]
    cat_values = domain_values.split(',')
    if (len(cat_values) < 1):
        raise ValueError(('Expected at least one value in %s' % line))
    name = line[:first_bracket].strip()
    values = [value.strip() for value in cat_values]
    od = OrderedDict()
    od['name'] = name
    od['values'] = values
    return od
def _parse_categorical(line):
    if ('#' in line):
        comment_begins = line.find('#')
        line = line[:comment_begins]
    if ((line.count('{') != 1) or (line.count('}') != 1)):
        raise ValueError(('Malformed parameter line %s' % line))
    first_bracket = line.find('{')
    second_bracket = line.find('}')
    domain_values = line[(first_bracket + 1):second_bracket]
    cat_values = domain_values.split(',')
    if (len(cat_values) < 1):
        raise ValueError(('Expected at least one value in %s' % line))
    name = line[:first_bracket].strip()
    values = [value.strip() for value in cat_values]
    od = OrderedDict()
    od['name'] = name
    od['values'] = values
    return od