from pathlib import Path
p=Path('/usr/local/lib/python3.12/site-packages/graphiti_core/utils/maintenance/node_operations.py')
s=p.read_text()
old="            summary=node_data['summary'],\n"
new="            summary=(node_data.get('summary') or ''),\n"
if s.count(old)!=1:
    raise SystemExit(f'patch target count={s.count(old)}')
p.write_text(s.replace(old,new))
print('patched',p)
