MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / get_hierarchy

Function get_hierarchy

utils/pptx_utils.py:1931–1939  ·  view source on GitHub ↗
(outline, hierarchy=1)

Source from the content-addressed store, hash-verified

1929 return labeled_elements
1930
1931def get_hierarchy(outline, hierarchy=1):
1932 name_to_hierarchy = {}
1933 for key, section in outline.items():
1934 if key == "meta":
1935 continue
1936 name_to_hierarchy[section['name']] = hierarchy
1937 if 'subsections' in section:
1938 name_to_hierarchy.update(get_hierarchy(section['subsections'], hierarchy+1))
1939 return name_to_hierarchy
1940
1941def get_hierarchy_by_keys(outline, hierarchy=1):
1942 name_to_hierarchy = {}

Callers 4

gen_outline_layoutFunction · 0.50
deoverflowFunction · 0.50
gen_outline_layoutFunction · 0.50
deoverflowFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected