code: def _to_ndarray(x, dtype=np.int64):
      if isinstance(x, list):
          return np.array(x, dtype=dtype)
      else:
          return chainer.cuda.to_cpu(x).astype(dtype)
  
imports: import warnings
  import chainer
  import numpy
  import onnx
  from onnx.mapping import NP_TYPE_TO_TENSOR_TYPE
  from onnx_chainer.functions.opset_version import support
  from onnx_chainer import onnx_helper
label_desc: Use image node_id 6 for calling a global function with example usage: _to_ndarray(x, dtype) and returns: np, chainer