code: def test_Piecewise():
      # A piecewise linear
      expr = sy.Piecewise((0, x < 0), (x, x < 2), (1, True))  # ___/III
      result = aesara_code_(expr)
      assert result.owner.op == aet.switch
  
      expected = aet.switch(xt < 0, 0, aet.switch(xt < 2, xt, 1))
      assert theq(result, expected)
  
      expr = sy.Piecewise((x, x < 0))
      result = aesara_code_(expr)
      expected = aet.switch(xt < 0, xt, np.nan)
      assert theq(result, expected)
  
      expr = sy.Piecewise(
          (0, sy.And(x > 0, x < 2)), (x, sy.Or(x > 2, x < 0))
      )
      result = aesara_code_(expr)
      expected = aet.switch(
          aet.and_(xt > 0, xt < 2),
          0,
          aet.switch(aet.or_(xt > 2, xt < 0), xt, np.nan),
      )
      assert theq(result, expected)
  
imports: import logging
  from sympy.external import import_module
  from sympy.testing.pytest import raises, SKIP
  from sympy.utilities.exceptions import ignore_warnings
  import sympy
  from sympy.core.singleton import S
  from sympy.abc import x, y, z, t
  from sympy.printing.aesaracode import aesara_code, dim_handling, aesara_function
label_desc: Use image node_id 42 for calling a global function with example usage: test_Piecewise() without return types