code: def _regroup(args, fmt):
      """Reconstruct the structured arguments based on the flattened version.
  
      Parameters
      ----------
      args : NDArray, Symbol, or (nested) list of Symbol or NDArray
          We allow None inside the args.
      fmt : (nested) list of ints
          Stores the format information of the original structured args.
  
      Returns
      -------
      ret : NDArray, Symbol, or (nested) list of Symbol or NDArray
  
      """
  
      def _merger(args, fmt):
          """Recursive call to merge the arguments"""
          if isinstance(fmt, int):
              if fmt < -1:
                  raise ValueError(
                      "Unsupported encoded format {}.".format(fmt)
                  )
              if fmt == 0:
                  return args[0], args[1:]
              if fmt == -1:
                  if args[0] is not None:
                      raise ValueError(
                          "We do not support passing types that are not None"
                          " when the initial HybridBlock has received NoneType and"
                          " has been hybridized."
                          " Received arg = {}, fmt = {}.".format(
                              args[0], fmt
                          )
                      )
                  return None, args[1:]
              else:
                  return args[:fmt], args[fmt:]
  
          if not isinstance(args, (list, tuple)):
              raise ValueError(
                  "When hybridized, the output of HybridBlock must be (nested)"
                  " list of Symbol or NDArray, "
                  "but got {} of type {}".format(args, type(args))
              )
          ret = []
          for i in fmt:
              res, args = _merger(args, i)
              ret.append(res)
          return ret, args
  
      return _merger(args, fmt)[0]
  
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 2 for calling a global function with example usage: _regroup(args, fmt) and returns: _merger, ret,  args, args,  args, None,  args, args,  args