from typing import OrderedDict


def parse_inp_section_config(raw_conf):
    """
    normalize the config information in the YAML
    :return:
    >>> from swmmio.defs import INP_OBJECTS
    >>> conds_config = INP_OBJECTS['CONDUITS']
    >>> parse_inp_section_config(conds_config)
    OrderedDict([('columns', ['Name', 'InletNode', 'OutletNode', 'Length', 'ManningN', 'InOffset', 'OutOffset', 'InitFlow', 'MaxFlow'])])
    >>> parse_inp_section_config(INP_OBJECTS['LOSSES'])
    OrderedDict([('columns', ['Link', 'Inlet', 'Outlet', 'Average', 'Flap Gate', 'SeepageRate'])])
    """

    conf = OrderedDict()
    if isinstance(raw_conf, list):
        # has a simple list, assumed to be columns
        conf['columns'] = raw_conf
    elif isinstance(raw_conf, (dict, OrderedDict)):
        if 'keys' in raw_conf:
            # object is special case like OPTIONS
            conf.update(raw_conf)
            conf['columns'] = ['Key', 'Value']
        else:
            conf.update(raw_conf)

    return conf