code: def test_CheckAndRaise_pickle():
      import pickle
  
      exc_msg = "this is the exception"
      check_and_raise = CheckAndRaise(CustomException, exc_msg)
  
      y = check_and_raise(pt.as_tensor(1), pt.as_tensor(0))
      y_str = pickle.dumps(y)
      new_y = pickle.loads(y_str)
  
      assert y.owner.op == new_y.owner.op
      assert y.owner.op.msg == new_y.owner.op.msg
      assert y.owner.op.exc_type == new_y.owner.op.exc_type
  
imports: import numpy
  import pytest
  import scipy.sparse
  import pytensor
  import pytensor.tensor
  from pytensor.compile.mode import OPT_FAST_RUN, Mode
  from pytensor.graph import vectorize_graph
  from pytensor.graph.basic import Constant, equal_computations
  from pytensor.raise_op import Assert, CheckAndRaise, assert_op
  from pytensor.scalar.basic import ScalarType, float64
  from pytensor.sparse import as_sparse_variable
  from pytensor.tensor.basic import second
  from pytensor.tensor.elemwise import DimShuffle
  from tests import unittest_tools
label_desc: Use image node_id 2 for calling a global function with example usage: test_CheckAndRaise_pickle() without return types