code: def _flatten(args, inout_str):
      if isinstance(args, ndarray.NDArray):
          return [args], int(0)
  
      assert isinstance(args, (list, tuple)), (
          f"{inout_str} must be (nested) list of NDArray, "
          f"but got {str(args)} of type {str(type(args))}"
      )
      flat = []
      fmts = []
      for i in args:
          arg, fmt = _flatten(i, inout_str)
          flat.extend(arg)
          fmts.append(fmt)
      return flat, fmts
  
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 3 for calling a global function with example usage: _flatten(args, inout_str) and returns: flat,  fmts, list,  int