code: def test_L2():
      b1 = L2(Interval(-oo, 1))
      assert isinstance(b1, L2)
      assert b1.dimension is oo
      assert b1.interval == Interval(-oo, 1)
  
      x = Symbol("x", real=True)
      y = Symbol("y", real=True)
      b2 = L2(Interval(x, y))
      assert b2.dimension is oo
      assert b2.interval == Interval(x, y)
      assert b2.subs(x, -1) == L2(Interval(-1, y))
  
file_path: sympy/sympy/physics/quantum/tests/test_hilbert.py
imports: from sympy.physics.quantum.hilbert import HilbertSpace, ComplexSpace, L2, FockSpace, TensorProductHilbertSpace, DirectSumHilbertSpace, TensorPowerHilbertSpace
  from sympy.core.numbers import oo
  from sympy.core.symbol import Symbol
  from sympy.printing.repr import srepr
  from sympy.printing.str import sstr
  from sympy.sets.sets import Interval
label_desc: Use image node_id 3 for calling a global function with example usage: test_L2() without return types