code: def slice(self, rindex):
          
          res = DMatrix(None, feature_names=self.feature_names)
          res.handle = ctypes.c_void_p()
          _check_call(_LIB.XGDMatrixSliceDMatrix(self.handle,
                                                 c_array(ctypes.c_int, rindex),
                                                 len(rindex),
                                                 ctypes.byref(res.handle)))
          return res
docs: Slice the DMatrix and return a new DMatrix that only contains `rindex`.
  
          Parameters
          ----------
          rindex : list
              List of indices to be selected.
  
          Returns
          -------
          res : DMatrix
              A new DMatrix containing only selected indices.