b70a477198c4b602b98417c6dacdf3988ef8b2ff,tensorboard/plugins/histogram/histograms_plugin.py,HistogramsPlugin,histograms_impl,#HistogramsPlugin#Any#Any#Any#,122

Before Change


      """
      if downsample_to is not None:
        // Wrap the query in an outer one that samples.
        query = """
          SELECT *
          FROM 
            (%(query)s
             ORDER BY RANDOM()
             LIMIT %(downsample_to)d)
        """ % {
            "query": query,
            "downsample_to": downsample_to,
        }
      query = """
        %s
        ORDER BY step
      """ % query
      cursor = db.execute(query, (run, tag, metadata.PLUGIN_NAME))
      events = [(row[0], row[1], self._get_values(row[2], row[3], row[4]))
                for row in cursor]
    else:
      // Serve data from events files.

After Change


    if self._db_connection_provider:
      // Serve data from the database.
      db = self._db_connection_provider()
      cursor = db.cursor()
      // Prefetch the tag ID matching this run and tag.
      cursor.execute(
          """
          SELECT
            tag_id
          FROM Tags
          JOIN Runs USING (run_id)
          WHERE
            Runs.run_name = :run
            AND Tags.tag_name = :tag
            AND Tags.plugin_name = :plugin
          """,
          {"run": run, "tag": tag, "plugin": metadata.PLUGIN_NAME})
      row = cursor.fetchone()
      if not row:
        raise ValueError("No histogram tag %r for run %r" % (tag, run))
      (tag_id,) = row
      // Fetch tensor values, optionally with linear-spaced sampling by step.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: tensorflow/tensorboard
Commit Name: b70a477198c4b602b98417c6dacdf3988ef8b2ff
Time: 2018-03-09
Author: nfelt@users.noreply.github.com
File Name: tensorboard/plugins/histogram/histograms_plugin.py
Class Name: HistogramsPlugin
Method Name: histograms_impl


Project Name: numerai/submission-criteria
Commit Name: 3bf5f2de89807642dcd1e030e45226ff3944779b
Time: 2017-11-10
Author: xander@numer.ai
File Name: originality.py
Class Name:
Method Name: submission_originality


Project Name: numerai/submission-criteria
Commit Name: 3bf5f2de89807642dcd1e030e45226ff3944779b
Time: 2017-11-10
Author: xander@numer.ai
File Name: database_manager.py
Class Name: DatabaseManager
Method Name: get_date_created