code: def apply(self, doc, split, train, lfs, **kwargs):
          
          logger.debug(f"Document: {doc}")
  
          if lfs is None:
              raise ValueError("Must provide lfs kwarg.")
  
          self.lfs = lfs
  
          # Get all the candidates in this doc that will be labeled
          cands_list = get_cands_list_from_split(
              self.session, self.candidate_classes, doc, split
          )
  
          label_map = dict()
          for cands in cands_list:
              records = list(
                  get_mapping(self.session, Label, cands, self._f_gen, label_map)
              )
              batch_upsert_records(self.session, Label, records)
  
          # Insert all Label Keys
          if train:
              upsert_keys(self.session, LabelKey, label_map)
  
          # This return + yield makes a completely empty generator
          return
          yield
docs: Extract candidates from the given Context.
  
          :param doc: A document to process.
          :param split: Which split to use.
          :param train: Whether or not to insert new LabelKeys.
          :param lfs: The list of functions to use to generate labels.