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

Before Change


    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

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: 4

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: polyaxon/polyaxon
Commit Name: 979546167c1e0f935a368e9d01895d1cd624986c
Time: 2019-02-11
Author: mouradmourafiq@gmail.com
File Name: polystores/stores/s3_store.py
Class Name: S3Store
Method Name: delete


Project Name: comic/grand-challenge.org
Commit Name: c2a9ae3627fb4944a240439baa1082f539a100ec
Time: 2017-12-12
Author: pkcakeout@gmail.com
File Name: app/jqfileupload/widgets/uploader.py
Class Name:
Method Name: cleanup_stale_files