code: def test_serialize_dtype_error_checking():
      dtype = cudf.IntervalDtype("float", "right")
      header, frames = dtype.serialize()
      with pytest.raises(AssertionError):
          # Invalid number of frames
          type(dtype).deserialize(
              header, [None] * (header["frame_count"] + 1)
          )
      with pytest.raises(AssertionError):
          # mismatching class
          cudf.StructDtype.deserialize(header, frames)
  
imports: import pickle
  import msgpack
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.testing import _utils
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 2 for calling a global function with example usage: test_serialize_dtype_error_checking() without return types