21971e673fabe25d3e7da6712f80222760516113,server/website/website/tasks/async_tasks.py,,clean_metric_data,#Any#Any#Any#,149

Before Change


            metric_labels.append(metric)
    LOG.debug(matrix.shape)
    // If they are useless columns in the matrix
    if unused_columns:
        indexes = [i for i, n in enumerate(metric_labels) if n in unused_columns]
        // Delete unused columns
        matrix = np.delete(matrix, indexes, 1)
        for i in sorted(indexes, reverse=True):
            del metric_labels[i]
    return matrix, metric_labels


def save_execution_time(start_ts, fn, result):

After Change


    metric_labels_dict = {n: i for i, n in enumerate(metric_labels)}
    // column labels in matrix has the same order as ones in metric catalog
    // missing values are filled with default_val
    for i, metric_name in enumerate(metric_cat):
        if metric_name in metric_labels_dict:
            index = metric_labels_dict[metric_name]
            matrix[:, i] = metric_matrix[:, index]
    LOG.debug(matrix.shape)
    return matrix, metric_cat

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: cmu-db/ottertune
Commit Name: 21971e673fabe25d3e7da6712f80222760516113
Time: 2020-02-26
Author: bohanzhang95@gmail.com
File Name: server/website/website/tasks/async_tasks.py
Class Name:
Method Name: clean_metric_data


Project Name: merenlab/anvio
Commit Name: 04bd843050842490a291ce610079a268f043a287
Time: 2019-12-12
Author: alon.shaiber@gmail.com
File Name: anvio/migrations/config/v0_to_v1.py
Class Name:
Method Name: migrate


Project Name: facebookresearch/ParlAI
Commit Name: 3e8320d3775fcba51de11aabda3f35e9dcdc71e6
Time: 2020-07-10
Author: edinan@fb.com
File Name: parlai/core/agents.py
Class Name:
Method Name: create_agent_from_opt_file