parameters: (self, expr, args)
docstring: Canonicalize an expression, w.r.t. canonicalized arguments.
docstring_summary: Canonicalize an expression, w.r.t. canonicalized arguments.
docstring_tokens: Canonicalize an expression w . r . t . canonicalized arguments .
function: def canonicalize_expr(self, expr, args):
          """Canonicalize an expression, w.r.t. canonicalized arguments."""
          # Constant trees are collapsed, but parameter trees are preserved.
          if isinstance(expr, Expression) and (
                  expr.is_constant() and not expr.parameters()):
              return expr, []
          elif type(expr) in self.canon_methods:
              return self.canon_methods[type(expr)](expr, args)
          else:
              return expr.copy(args), []
function_tokens: def canonicalize_expr ( self , expr , args ) : # Constant trees are collapsed, but parameter trees are preserved. if isinstance ( expr , Expression ) and ( expr . is_constant ( ) and not expr . parameters ( ) ) : return expr , [ ] elif type ( expr ) in self . canon_methods : return self . canon_methods [ type ( expr ) ] ( expr , args ) else : return expr . copy ( args ) , [ ]