class_docstr: A python wrapper a C++ dataset.
  
  Parameters
  ----------
  handle : DatasetHandle, required
      The handle to the underlying C++ Dataset.
class_docstr_tok: ["A","python","wrapper","a","C++","dataset",".","Parameters","--","--","--","--","--","handle",":","DatasetHandle",",","required","The","handle","to","the","underlying","C++","Dataset","."]
code: def __getitem__(self, idx):
      orig_idx = idx
      if idx < 0:
          idx += self._len
      # check bound
      if idx < 0 or idx >= self._len:
          raise IndexError(
              "Index {} out of bound: (0, {})".format(
                  orig_idx, self._len
              )
          )
      create_ndarray_fn = (
          _np_ndarray_cls if is_np_array() else _ndarray_cls
      )
      output_vars = ctypes.POINTER(NDArrayHandle)()
      num_output = ctypes.c_int(0)
      check_call(
          _LIB.MXDatasetGetItems(
              self.handle,
              ctypes.c_uint64(idx),
              ctypes.byref(num_output),
              ctypes.byref(output_vars),
          )
      )
      out = [
          create_ndarray_fn(
              ctypes.cast(output_vars[i], NDArrayHandle), False
          )
          for i in range(num_output.value)
      ]
      for i in range(num_output.value):
          if out[i].size == 1:
              out[i] = out[i].asnumpy()
      if len(out) > 1:
          return tuple(out)
      return out[0]
  
imports: import sys
  import ctypes
  from .dataset import Dataset
  from .sampler import Sampler
  from ...base import _LIB
  from ...base import c_str_array, mx_uint, py_str
  from ...base import DatasetHandle, NDArrayHandle, BatchifyFunctionhandle
  from ...base import check_call, build_param_doc
  from ...ndarray import NDArray
  from ...ndarray import _ndarray_cls
  from ...numpy.multiarray import _np_ndarray_cls
  from ...util import is_np_array, default_array
  from ...io import io
label_desc: Use image node_id 4 for calling the MXDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: out, tuple