code: def _init_from_csr(self, csr):
          
          if len(csr.indices) != len(csr.data):
              raise ValueError('length mismatch: {} vs {}'.format(len(csr.indices), len(csr.data)))
          handle = ctypes.c_void_p()
          _check_call(_LIB.XGDMatrixCreateFromCSREx(c_array(ctypes.c_size_t, csr.indptr),
                                                    c_array(ctypes.c_uint, csr.indices),
                                                    c_array(ctypes.c_float, csr.data),
                                                    ctypes.c_size_t(len(csr.indptr)),
                                                    ctypes.c_size_t(len(csr.data)),
                                                    ctypes.c_size_t(csr.shape[1]),
                                                    ctypes.byref(handle)))
          self.handle = handle
docs: Initialize data from a CSR matrix.