225d31587eeb9aca226158e346c8e9730777913c,perfkitbenchmarker/publisher.py,,RepublishJSONSamples,#Any#,763

Before Change


  with open(path, "r") as file:
    for line in file:
      try:
        raw_dict = json.loads(line)
        labels = raw_dict.pop("labels")
        metadata = dict()
        // labels is a comma-seprated list of key, value pairs
        for pair in labels.split(","):

After Change


    // Chop "|" at the beginning and end of labels and split labels by "|,|"
    fields = sample.pop("labels")[1:-1].split("|,|")
    // Turn the fields into [[key, value], ...]
    key_values = [field.split(":", 1) for field in fields]
    sample["metadata"] = {k: v for k, v in key_values}

  // We can"t use a SampleCollector because SampleCollector.AddSamples depends on
  // having a benchmark and a benchmark_spec.
  publishers = SampleCollector._PublishersFromFlags()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 225d31587eeb9aca226158e346c8e9730777913c
Time: 2017-02-24
Author: nlavine@google.com
File Name: perfkitbenchmarker/publisher.py
Class Name:
Method Name: RepublishJSONSamples


Project Name: tensorflow/tensorboard
Commit Name: 21491193a9943e93c94a5bf85bf608d43585eb86
Time: 2019-07-17
Author: wchargin@gmail.com
File Name: tensorboard/plugins/text/text_plugin.py
Class Name: TextPlugin
Method Name: index_impl


Project Name: chartbeat-labs/textacy
Commit Name: 800dcf66028cc6d35a9d3984d9bff1992a13f16e
Time: 2016-02-11
Author: burton@chartbeat.com
File Name: textacy/data.py
Class Name:
Method Name: load_depechemood