MCPcopy Index your code
hub / github.com/omkarcloud/botasaurus / flatten_deep

Function flatten_deep

botasaurus/list_utils.py:63–80  ·  view source on GitHub ↗

Flattens an array recursively. Args: array (list): List to flatten. Returns: list: Flattened list. Example: >>> flatten_deep([[1], [2, [3]], [[4]]]) [1, 2, 3, 4] .. versionadded:: 2.0.0

(array)

Source from the content-addressed store, hash-verified

61 return flatten_depth(array, depth=1)
62
63def flatten_deep(array):
64 """
65 Flattens an array recursively.
66
67 Args:
68 array (list): List to flatten.
69
70 Returns:
71 list: Flattened list.
72
73 Example:
74
75 >>> flatten_deep([[1], [2, [3]], [[4]]])
76 [1, 2, 3, 4]
77
78 .. versionadded:: 2.0.0
79 """
80 return flatten_depth(array, depth=-1)

Callers

nothing calls this directly

Calls 1

flatten_depthFunction · 0.85

Tested by

no test coverage detected