25ca9c249fd3e11bb166b42ffeb2433036964bd1,brian2/codegen/generators/GSL_generator.py,GSLWeaveCodeGenerator,write_dataholder,#GSLWeaveCodeGenerator#Any#,350

Before Change


        except:
            var_obj = self.other_variables[var]
        dtype = self.generator.c_data_type(var_obj.dtype)
        if isinstance(var_obj, ArrayVariable):
            pointer_name = self.generator.get_array_name(var_obj, access_data=True)
            restrict = self.generator.restrict
            if var_obj.scalar:
                restrict = ""
            return "{dtype}* {res} {var};".format(dtype=dtype, res=restrict, var=pointer_name)
        else:
            return "{dtype} {var};".format(dtype=dtype, var=var)

    def get_replacer(self, var, to_replace):
        try:
            var_obj = self.variables[var]
        except:

After Change



    def write_dataholder(self, variables_in_vector):
        code = ["\nstruct dataholder\n{\n\tint _idx;"]
        for var_obj in variables_in_vector:
            if var_obj.name == "t" or "_gsl" in var_obj.name:
                continue
            code += ["\t"+self.write_dataholder_single(var_obj)]
        code += ["\n};"]
        return ("\n").join(code)

    def to_replace_vector_vars(self, variables_in_vector):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: brian-team/brian2
Commit Name: 25ca9c249fd3e11bb166b42ffeb2433036964bd1
Time: 2017-07-05
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLWeaveCodeGenerator
Method Name: write_dataholder


Project Name: pyannote/pyannote-audio
Commit Name: 2fcc7e8c87bd3d8f44b491d1f43be7002a2db6d7
Time: 2019-04-08
Author: bredin@limsi.fr
File Name: pyannote/audio/labeling/tasks/base.py
Class Name: LabelingTaskGenerator
Method Name: _load_metadata


Project Name: pyannote/pyannote-audio
Commit Name: dc357b0e9d2bc40633f738997e8b7d17221c28fd
Time: 2018-06-29
Author: bredin@limsi.fr
File Name: pyannote/audio/util.py
Class Name:
Method Name: from_numpy