MCPcopy Create free account
hub / github.com/VectifyAI/PageIndex / clean_structure_post

Function clean_structure_post

pageindex/utils.py:454–464  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

452 return structure
453
454def clean_structure_post(data):
455 if isinstance(data, dict):
456 data.pop('page_number', None)
457 data.pop('start_index', None)
458 data.pop('end_index', None)
459 if 'nodes' in data:
460 clean_structure_post(data['nodes'])
461 elif isinstance(data, list):
462 for section in data:
463 clean_structure_post(section)
464 return data
465
466def remove_fields(data, fields=['text']):
467 if isinstance(data, dict):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected