322a4fb58929a83b54c80417f555d2a2f32abf75,parser/python/nnef/printer.py,,format_result,#Any#,53

Before Change


    if isinstance(value, (list, tuple)):
        string = "[" if isinstance(value, list) else "("
        for idx, item in enumerate(value):
            if idx != 0:
                string += ", "
            string += format_result(item)
        string += "]" if isinstance(value, list) else ")"
        return string
    elif isinstance(value, _nnef.Identifier):
        return value
    else:

After Change




def format_result(value):
    if isinstance(value, list):
        return "[" + ", ".join(format_result(item) for item in value) + "]"
    elif isinstance(value, tuple):
        return "(" + ", ".join(format_result(item) for item in value) + ")"
    elif isinstance(value, _nnef.Identifier):
        return value
    else:
        raise TypeError("results must be of type nnef.Identifier or list/tuple of such, found: " + str(type(value)))


def format_shapes(result, tensors):
    if isinstance(result, list):
        return "[" + ", ".join(format_shapes(item, tensors) for item in result) + "]"
    elif isinstance(result, tuple):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: KhronosGroup/NNEF-Tools
Commit Name: 322a4fb58929a83b54c80417f555d2a2f32abf75
Time: 2019-07-17
Author: viktor.gyenes@aimotive.com
File Name: parser/python/nnef/printer.py
Class Name:
Method Name: format_result


Project Name: KhronosGroup/NNEF-Tools
Commit Name: 322a4fb58929a83b54c80417f555d2a2f32abf75
Time: 2019-07-17
Author: viktor.gyenes@aimotive.com
File Name: parser/python/nnef/printer.py
Class Name:
Method Name: format_argument


Project Name: deepchem/deepchem
Commit Name: 563207ae6bd9a8565243b04dcd92af9c33bac524
Time: 2020-02-12
Author: peastman@stanford.edu
File Name: deepchem/models/keras_model.py
Class Name: KerasModel
Method Name: fit_generator


Project Name: KhronosGroup/NNEF-Tools
Commit Name: 322a4fb58929a83b54c80417f555d2a2f32abf75
Time: 2019-07-17
Author: viktor.gyenes@aimotive.com
File Name: parser/python/nnef/printer.py
Class Name:
Method Name: format_result