code: def _preprocess_data(self, X, Y=None, idxs=None, train=False):
          
  
          C, F = X
  
          if Y is not None:
              Y = np.array(Y).astype(np.float32)
  
          if idxs is None:
              if Y is not None:
                  return (
                      [
                          [
                              F.indices[F.indptr[i] : F.indptr[i + 1]],
                              F.data[F.indptr[i] : F.indptr[i + 1]],
                          ]
                          for i in range(len(C))
                      ],
                      Y,
                  )
              else:
                  return [
                      [
                          F.indices[F.indptr[i] : F.indptr[i + 1]],
                          F.data[F.indptr[i] : F.indptr[i + 1]],
                      ]
                      for i in range(len(C))
                  ]
          if Y is not None:
              return (
                  [
                      [
                          F.indices[F.indptr[i] : F.indptr[i + 1]],
                          F.data[F.indptr[i] : F.indptr[i + 1]],
                      ]
                      for i in idxs
                  ],
                  Y[idxs],
              )
          else:
              return [
                  [
                      F.indices[F.indptr[i] : F.indptr[i + 1]],
                      F.data[F.indptr[i] : F.indptr[i + 1]],
                  ]
                  for i in idxs
              ]
docs: Preprocess the data:
          1. Select subset of the input if idxs exists.
  
          :param X: The input data of the model.
          :type X: pair with candidates and corresponding features
          :param Y: The labels of input data.
          :type Y: list or numpy.array
          :param idxs: The selected indices of input data.
          :type idxs: list or numpy.array
          :param train: Indicator of training set.
          :type train: bool
          :return: Preprocessed data.
          :rtype: list of (features, feature_weights) pair