code: def _flatten(args, inout_str):
      """Parse the arguments into a flattened list + an additional format array.
      The format array stores the structure of the original arguments to help reconstruct the inputs.
  
      Parameters
      ----------
      args : NDArray, Symbol, or (nested) list of Symbol or NDArray
          We allow None inside the args.
      inout_str : str
          The name of the HybridBlock
  
      Returns
      -------
      flat : list of Symbol or NDArray
          The flatten version of the input args.
      fmts : (nested) list of ints
          Stores the format information of the original structured args.
      """
      if isinstance(args, np_ndarray):
          return [args], int(0)
      if isinstance(args, Symbol):
          length = len(args.list_outputs())
          length = length if length > 1 else 0
          return [args], int(length)
      if args is None:
          return [None], int(-1)
  
      if not isinstance(args, (list, tuple)):
          raise ValueError(
              "When hybridized, the input of HybridBlock {}"
              " must be (nested) list of Symbol"
              " or NDArray, "
              "but got {} of type {}".format(
                  inout_str, str(args), str(type(args))
              )
          )
      flat = []
      fmts = []
      for i in args:
          arg, fmt = _flatten(i, inout_str)
          flat.extend(arg)
          fmts.append(fmt)
      return flat, fmts
  
file_path: mxnet/python/mxnet/ndarray/numpy_extension/control_flow.py
imports: from .None import _api_internal
  from .._internal import NDArrayBase
  from ...util import set_module
  from ...numpy import ndarray
  from ...symbol import Symbol
  from ...base import _as_list
  from ...None import symbol, _deferred_compute, autograd
  from ...attribute import AttrScope, current
label_desc: Use image node_id 1 for calling a global function with example usage: _flatten(args, inout_str) and returns: flat,  fmts, list,  int, list,  int, list,  int