code: def fit(self, documents, labels, weights=None):
          
          block_groups = np.array([self.blockifier.blockify(doc) for doc in documents])
          mask = [self._has_enough_blocks(blocks) for blocks in block_groups]
          block_groups = block_groups[mask]
          labels = np.concatenate(np.array(labels)[mask])
  
          # TODO: This only 'fit's one doc at a time. No feature fitting actually
          # happens for now, but this might be important if the features change
          features_mat = np.concatenate([self.features.fit_transform(blocks)
                                         for blocks in block_groups])
          if weights is None:
              self.model.fit(features_mat, labels)
          else:
              weights = np.concatenate(np.array(weights)[mask])
              self.model.fit(features_mat, labels, sample_weight=weights)
          return self
docs: Fit :class`Extractor` features and model to a training dataset.
  
          Args:
              blocks (List[Block])
              labels (``np.ndarray``)
              weights (``np.ndarray``)
  
          Returns:
              :class`Extractor`