8946a24d7c1a21a80ccaf86418c354cf87e84bfa,src/fonduer/supervision/labeler.py,LabelerUDF,apply,#LabelerUDF#Any#Any#Any#Any#Any#,205

Before Change


        )

        label_keys = set()
        for cands in cands_list:
            records = list(get_mapping(cands, self._f_gen, label_keys))
            batch_upsert_records(self.session, Label, records)

        // Insert all Label Keys
        if train or update:
            add_keys(self.session, LabelKey, label_keys)

        // This return + yield makes a completely empty generator

After Change


        self.lfs = lfs
        if docs:
            // Call apply on the specified docs for all splits
            split = ALL_SPLITS
            super(Labeler, self).apply(
                docs, split=split, train=train, lfs=self.lfs, clear=clear, **kwargs
            )
            // Needed to sync the bulk operations
            self.session.commit()
        else:
            // Only grab the docs containing candidates from the given split.
            split_docs = get_docs_from_split(
                self.session, self.candidate_classes, split
            )
            super(Labeler, self).apply(
                split_docs,
                split=split,
                train=train,
                lfs=self.lfs,
                clear=clear,
                **kwargs
            )
            // Needed to sync the bulk operations
            self.session.commit()

    def get_lfs(self):
        Return a list of lists of labeling functions for this Labeler.
        return self.lfs
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: HazyResearch/fonduer
Commit Name: 8946a24d7c1a21a80ccaf86418c354cf87e84bfa
Time: 2018-09-04
Author: lwhsiao@stanford.edu
File Name: src/fonduer/supervision/labeler.py
Class Name: LabelerUDF
Method Name: apply


Project Name: home-assistant/home-assistant
Commit Name: e0dd5a855870e007cc7c8900d79d73e8d56ce971
Time: 2016-07-11
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/recorder/__init__.py
Class Name: Recorder
Method Name: run


Project Name: mozilla/bugbug
Commit Name: 0b77df59635715ac4538e35ed2257f1d3dba8d83
Time: 2020-03-11
Author: babadie@mozilla.com
File Name: http_service/tests/conftest.py
Class Name:
Method Name: mock_repo