def VariableExpression(variable):
 assert isinstance(variable, Variable), (u'%s is not a Variable' % variable)
 if is_indvar(variable.name):
  return IndividualVariableExpression(variable)
 elif is_funcvar(variable.name):
  return FunctionVariableExpression(variable)
 elif is_eventvar(variable.name):
  return EventVariableExpression(variable)
 else:
  return ConstantExpression(variable)

def VariableExpression ( variable ) : assert isinstance ( variable , Variable ) , ( u'%s is not a Variable' % variable ) if is_indvar ( variable . name ) : return IndividualVariableExpression ( variable ) elif is_funcvar ( variable . name ) : return FunctionVariableExpression ( variable ) elif is_eventvar ( variable . name ) : return EventVariableExpression ( variable ) else : return ConstantExpression ( variable )
this is a factory method that instantiates and returns a subtype of abstractvariableexpression appropriate for the given variable .