3b1bf154144ca1c637471605384c5a438ee6f659,deeplearning/clgen/corpuses/corpuses.py,Corpus,Create,#Corpus#,200

Before Change


    // Nothing to do for already-encoded databases.
    // TODO(github.com/ChrisCummins/clgen/issues/130): Refactor this after
    // splitting out Corpus class.
    if self.config.HasField("pre_encoded_corpus_url"):
      return

    preprocessed_lock_path = pathlib.Path(
        self.preprocessed.url[len("sqlite:///"):]).parent / "LOCK"
    with lockfile.LockFile(preprocessed_lock_path):
      self.preprocessed.Create(self.config)

After Change


      config_to_store.ClearField("contentfiles")
      corpus = session.GetOrAdd(
          dashboard_db.Corpus,
          config_proto_sha1=crypto.sha1(config_to_store.SerializeToString()),
          config_proto=str(config_to_store),
          preprocessed_url=self.preprocessed.url,
          encoded_url=self.encoded.url,
          summary=self.GetShortSummary(),
      )
      session.flush()
      self._dashboard_db_id = corpus.id

  @property
  def dashboard_db_id(self) -> int:
    if not self._created:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: ChrisCummins/clgen
Commit Name: 3b1bf154144ca1c637471605384c5a438ee6f659
Time: 2019-08-21
Author: chrisc.101@gmail.com
File Name: deeplearning/clgen/corpuses/corpuses.py
Class Name: Corpus
Method Name: Create


Project Name: cve-search/cve-search
Commit Name: 5dc053923afeefed29ce7fc6d56b26a62acac432
Time: 2019-11-07
Author: sami.kairajarvi@gmail.com
File Name: sbin/db_mgmt_json.py
Class Name:
Method Name: process_cve_item


Project Name: GoogleCloudPlatform/healthcare
Commit Name: ed36cb7118194e02d2eaee2da63e07840b60db8b
Time: 2019-06-19
Author: ruihuang@google.com
File Name: deploy/config/templates/firewall/firewall.py
Class Name:
Method Name: generate_config