MCPcopy Create free account
hub / github.com/ValueCell-ai/valuecell / count_keys

Function count_keys

python/valuecell/utils/i18n_utils.py:521–529  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

519
520 # Count keys recursively
521 def count_keys(obj):
522 count = 0
523 if isinstance(obj, dict):
524 for key, value in obj.items():
525 if isinstance(value, dict):
526 count += count_keys(value)
527 else:
528 count += 1
529 return count
530
531 result["key_count"] = count_keys(data)
532

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected