code: def test_subs():
      assert b21.subs(b2, b1) == Basic(b1, b1)
      assert b21.subs(b2, b21) == Basic(b21, b1)
      assert b3.subs(b2, b1) == b2
  
      assert b21.subs([(b2, b1), (b1, b2)]) == Basic(b2, b2)
  
      assert b21.subs({b1: b2, b2: b1}) == Basic(b2, b2)
      assert b21.subs(
          collections.ChainMap({b1: b2}, {b2: b1})
      ) == Basic(b2, b2)
      assert b21.subs(
          collections.OrderedDict([(b2, b1), (b1, b2)])
      ) == Basic(b2, b2)
  
      raises(ValueError, lambda: b21.subs("bad arg"))
      raises(ValueError, lambda: b21.subs(b1, b2, b3))
      # dict(b1=foo) creates a string 'b1' but leaves foo unchanged; subs
      # will convert the first to a symbol but will raise an error if foo
      # cannot be sympified; sympification is strict if foo is not string
      raises(ValueError, lambda: b21.subs(b1="bad arg"))
  
      assert Symbol("text").subs({"text": b1}) == b1
      assert Symbol("s").subs({"s": 1}) == 1
  
imports: import collections
  from typing import TypeVar, Generic
  from sympy.assumptions.ask import Q
  from sympy.core.basic import Basic, Atom, as_Basic, _atomic, _aresame
  from sympy.core.containers import Tuple
  from sympy.core.function import Function, Lambda
  from sympy.core.numbers import I, pi, Float
  from sympy.core.singleton import S
  from sympy.core.symbol import symbols, Symbol, Dummy
  from sympy.concrete.summations import Sum
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.functions.special.gamma_functions import gamma
  from sympy.integrals.integrals import Integral
  from sympy.functions.elementary.exponential import exp
  from sympy.testing.pytest import raises, warns_deprecated_sympy
label_desc: Use image node_id 7 for calling a global function with example usage: test_subs() without return types