code: def test_substitute():
      x = Variable("x", Real)
      y = Variable("y", Real)
      z = Variable("z", Real)
  
      f = x * y + x * z
  
      assert f(y=2) is x * 2 + x * z
      assert f(z=2) is x * y + x * 2
      assert f(y=x) is x * x + x * z
      assert f(x=y) is y * y + y * z
      assert f(y=z, z=y) is x * z + x * y
      assert f(x=y, y=z, z=x) is y * z + y * x
  
imports: import copy
  import io
  import itertools
  import pickle
  import pprint
  import typing
  from collections import OrderedDict
  from functools import reduce
  import numpy
  import pytest
  import funsor
  import funsor.ops
  from funsor.cnf import Contraction
  from funsor.domains import Array, Bint, Product, Real, Reals
  from funsor.interpretations import eager, eager_or_die, lazy, normalize, reflect, sequential
  from funsor.interpreter import reinterpret
  from funsor.tensor import REDUCE_OP_TO_NUMERIC
  from funsor.terms import Binary, Cat, Independent, Lambda, Number, Reduce, Slice, Stack, Subs, Tuple, Variable, to_data, to_funsor
  from funsor.testing import assert_close, check_funsor, random_tensor
label_desc: Use image node_id 18 for calling a global function with example usage: test_substitute() without return types