958c796ba3a6fb884eb5a4a1a830f7c810c0c408,snorkel/viewer.py,Viewer,__init__,#Viewer#Any#Any#Any#Any#Any#Any#,41

Before Change


        name = annotator_name if annotator_name is not None else getpass.getuser()

        // Sets up the AnnotationKey to use
        try:
            _, self.annotator = get_or_create_single_key_set(self.session, name)
        except ValueError:
            raise ValueError("annotator_name " + unicode(name) + " is already in use for an incompatible " +
                             "AnnotationKey and/or AnnotationKeySet. Please specify a new annotator_name.")

        // Viewer display configs
        self.n_per_page = n_per_page
        self.height     = height

        // Note that the candidates are not necessarily commited to the DB, so they *may not have* non-null ids

After Change



        // Sets up the AnnotationKey to use
        self.annotator = self.session.query(AnnotationKey).filter(AnnotationKey.name == name).first()
        if self.annotator is None:
            self.annotator = AnnotationKey(name=name)
            session.add(self.annotator)
            session.commit()

        // Viewer display configs
        self.n_per_page = n_per_page
        self.height     = height

        // Note that the candidates are not necessarily commited to the DB, so they *may not have* non-null ids
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: snorkel-team/snorkel
Commit Name: 958c796ba3a6fb884eb5a4a1a830f7c810c0c408
Time: 2016-12-08
Author: ajratner@gmail.com
File Name: snorkel/viewer.py
Class Name: Viewer
Method Name: __init__


Project Name: home-assistant/home-assistant
Commit Name: bfb5089ed59f1df8cf53a3b517ac6b091f539a26
Time: 2015-03-08
Author: andyt05@gmail.com
File Name: homeassistant/components/device_tracker/nmap_tracker.py
Class Name: NmapDeviceScanner
Method Name: _update_info


Project Name: pfnet/optuna
Commit Name: c5c5c7ecb570191dc4b9047122bec58d8dccfb2f
Time: 2018-04-24
Author: sano@preferred.jp
File Name: pfnopt/storages/rdb.py
Class Name: RDBStorage
Method Name: _check_table_schema_compatibility