25ca9c249fd3e11bb166b42ffeb2433036964bd1,brian2/codegen/generators/GSL_generator.py,GSLWeaveCodeGenerator,unpack_namespace,#GSLWeaveCodeGenerator#,377
Before Change
var_obj = self.variables[var]
except:
var_obj = self.other_variables[var]
if isinstance(var_obj, ArrayVariable):
pointer_name = self.generator.get_array_name(var_obj, access_data=True)
array_name = self.generator.get_array_name(var_obj, access_data=False)
if in_vector:
return "p.{ptr} = {array};".format(ptr=pointer_name, array=array_name)
else:
return ""
else:
if in_vector:
return "p.{var} = {var};".format(var=var)
else:
return ""
After Change
def unpack_namespace(self, variables_in_vector, variables_in_scalar):
code = []
for var_obj in self.variables.values():
in_vector = var_obj in variables_in_vector
in_scalar = var_obj in variables_in_scalar
code += [self.unpack_namespace_single(var_obj, in_vector, in_scalar)]
return ("\n").join(code)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
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: unpack_namespace
Project Name: masa-su/pixyz
Commit Name: 30028c6256de0cef715095e3994e396025c068d4
Time: 2020-05-04
Author: kaneko@weblab.t.u-tokyo.ac.jp
File Name: pixyz/losses/iteration.py
Class Name: IterativeLoss
Method Name: __init__
Project Name: dirty-cat/dirty_cat
Commit Name: a1a430fa42fa58cb3ba9d93f44749319928b78c8
Time: 2018-03-14
Author: patricio.cerda@inria.fr
File Name: dirty_cat/string_distances.py
Class Name:
Method Name: ngram_similarity