code: def _regroup(args, fmt):
      if isinstance(fmt, int):
          if fmt == 0:
              return args[0], args[1:]
          return args[:fmt], args[fmt:]
  
      assert isinstance(args, (list, tuple)), (
          "output must be (nested) list of NDArray, "
          f"but got {str(args)} of type {str(type(args))}"
      )
      ret = []
      for i in fmt:
          res, args = _regroup(args, i)
          ret.append(res)
      return ret, args
  
imports: import math
  import numpy
  import mxnet
  from ..device import current_device
  from ..random import uniform
  from ..base import _as_list
  from .None import ndarray
label_desc: Use image node_id 4 for calling a global function with example usage: _regroup(args, fmt) and returns: ret,  args, args,  args, args,  args