MCPcopy Index your code
hub / github.com/python/cpython / flatten

Function flatten

Lib/test/test_buffer.py:371–375  ·  view source on GitHub ↗

flatten list or return scalar

(lst)

Source from the content-addressed store, hash-verified

369 return _flatten(lst[0]) + _flatten(lst[1:])
370
371def flatten(lst):
372 """flatten list or return scalar"""
373 if atomp(lst): # scalar
374 return lst
375 return _flatten(lst)
376
377def slice_shape(lst, slices):
378 """Get the shape of lst after slicing: slices is a list of slice

Callers 1

verifyMethod · 0.85

Calls 2

atompFunction · 0.85
_flattenFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…