

def get_style_dict(tree):
    '\n    Some things that are considered lists are actually supposed to be H tags\n    (h1, h2, etc.) These can be denoted by their styleId\n    '
    headers = {
        'heading 1': 'h2',
        'heading 2': 'h3',
        'heading 3': 'h4',
        'heading 4': 'h5',
        'heading 5': 'h6',
        'heading 6': 'h6',
        'heading 7': 'h6',
        'heading 8': 'h6',
        'heading 9': 'h6',
        'heading 10': 'h6',
    }
    if (rpr is None):
        return {
            
        }
    w_namespace = get_namespace(tree, 'w')
    result = {
        
    }
    for el in tree:
        style_id = el.get(('%sstyleId' % w_namespace))
        el_result = {
            'header': False,
            'font_size': None,
            'based_on': None,
        }
        name = el.find(('%sname' % w_namespace))
        if (name is None):
            continue
        value = name.get(('%sval' % w_namespace)).lower()
        if (value in headers):
            el_result['header'] = headers[value]
        rpr = el.find(('%srPr' % w_namespace))
        if (rpr is None):
            continue
        size = rpr.find(('%ssz' % w_namespace))
        if (size is None):
            el_result['font_size'] = None
        else:
            el_result['font_size'] = size.get(('%sval' % w_namespace))
        based_on = el.find(('%sbasedOn' % w_namespace))
        if (based_on is None):
            el_result['based_on'] = None
        else:
            el_result['based_on'] = based_on.get(('%sval' % w_namespace))
        result[style_id] = el_result
    return result

dataset/ETHPy150Open PolicyStat/docx2html/docx2html/core.py get_style_dict/VarMisuse@70/205 `tree`->`rpr`