(Shortest import: from brian2.codegen.codeobject import constant_or_scalar)
from brian2.codegen.codeobject import constant_or_scalar)
Convenience function to generate code to access the value of a variable. Will return 'varname' if the variable is a constant, and array_name[0] if it is a scalar array.
'varname'
variable
array_name[0]