

def get_numbering_info(tree):
    '\n    There is a separate file called numbering.xml that stores how lists should\n    look (unordered, digits, lower case letters, etc.). Parse that file and\n    return a dictionary of what each combination should be based on list Id and\n    level of indentation.\n    '
    if (tree is None):
        return {
            
        }
    w_namespace = get_namespace(tree, 'w')
    num_ids = {
        
    }
    result = defaultdict(dict)
    for list_type in tree.findall(('%snum' % w_namespace)):
        list_id = list_type.get(('%snumId' % w_namespace))
        abstract_number = list_type.find(('%sabstractNumId' % w_namespace))
        num_ids[abstract_number.get(('%sval' % w_namespace))] = list_id
    for abstract_number in tree.findall(('%sabstractNum' % w_namespace)):
        abstract_num_id = abstract_number.get(('%sabstractNumId' % w_namespace))
        if (abstract_num_id not in num_ids):
            continue
        for lvl in abstract_number.findall(('%slvl' % w_namespace)):
            ilvl = int(lvl.get(('%silvl' % w_namespace)))
            lvl_format = lvl.find(('%snumFmt' % w_namespace))
            list_style = lvl_format.get(('%sval' % w_namespace))
            result[num_ids[abstract_num_id]][ilvl] = list_style
    return result

dataset/ETHPy150Open PolicyStat/docx2html/docx2html/core.py get_numbering_info/original