code: def _as_classic(a, allow_np):
      # TODO(junwu): This is a temp solution for allowing converting
      # np.ndarray to mx.nd.NDArray to be fed into the optimizer since
      # users may have custom optimizers implemented using mx.nd.NDArray ops.
      from ..numpy import ndarray as np_ndarray
  
      if isinstance(a, (tuple, list)):
          if any(isinstance(x, np_ndarray) for x in a):
              if allow_np:
                  return [x.as_nd_ndarray() for x in a]
              else:
                  raise ValueError(
                      "Converting np.ndarray to mx.nd.NDArray is not allowed"
                  )
      else:
          if isinstance(a, np_ndarray):
              if allow_np:
                  return a.as_nd_ndarray()
              else:
                  raise ValueError(
                      "Converting np.ndarray to mx.nd.NDArray is not allowed"
                  )
      return a
  
label_desc: Use image node_id 2 for calling a global function with example usage: _as_classic(a, allow_np) and returns: a, unknown, a