MCPcopy Index your code
hub / github.com/VectifyAI/PageIndex / clean_node

Function clean_node

pageindex/utils.py:361–367  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

359
360 # Helper function to clean empty children arrays
361 def clean_node(node):
362 if not node['nodes']:
363 del node['nodes']
364 else:
365 for child in node['nodes']:
366 clean_node(child)
367 return node
368
369 # Clean and return the tree
370 return [clean_node(node) for node in root_nodes]

Callers 1

list_to_treeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected