IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python function

flatten_one_level

flatten_one_level()

max.experimental.tree_utils.flatten_one_level(value)

source

Takes one interior node apart, one level deep.

Parameters:

value (Any) – An interior node, as is_node() judges it.

Returns:

(children, keys, meta); keys is empty when the children are positional.

Raises:

TypeError – If value is not an interior node, or a dict’s keys are not mutually sortable.

Return type:

tuple[tuple[Any, …], tuple[Any, …], Any]