MCPcopy Index your code
hub / github.com/graphql-python/graphene / flatten

Function flatten

graphene/utils/crunch.py:20–27  ·  view source on GitHub ↗
(data, index, values)

Source from the content-addressed store, hash-verified

18
19
20def flatten(data, index, values):
21 if isinstance(data, (list, tuple)):
22 flattened = [flatten(child, index, values) for child in data]
23 elif isinstance(data, Mapping):
24 flattened = {key: flatten(child, index, values) for key, child in data.items()}
25 else:
26 flattened = data
27 return insert(flattened, index, values)
28
29
30def crunch(data):

Callers 1

crunchFunction · 0.85

Calls 1

insertFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…