code: def assert_column_equal(col: _CuDFColumn, cudfcol):
      assert col.size() == cudfcol.size
      assert col.offset == 0
      assert col.null_count == cudfcol.null_count
      assert col.num_chunks() == 1
      if col.null_count == 0:
          pytest.raises(RuntimeError, col._get_validity_buffer)
          assert col.get_buffers()["validity"] is None
      else:
          assert_validity_equal(
              col.get_buffers()["validity"][0],
              cudfcol.mask,
              cudfcol.size,
              *col.describe_null,
          )
  
      if col.dtype[0] == _DtypeKind.CATEGORICAL:
          assert_buffer_equal(col.get_buffers()["data"], cudfcol.codes)
          assert col.get_buffers()["offsets"] is None
  
      elif col.dtype[0] == _DtypeKind.STRING:
          assert_buffer_equal(
              col.get_buffers()["data"], cudfcol.children[1]
          )
          assert_buffer_equal(
              col.get_buffers()["offsets"], cudfcol.children[0]
          )
  
      else:
          assert_buffer_equal(col.get_buffers()["data"], cudfcol)
          assert col.get_buffers()["offsets"] is None
  
      if col.null_count == 0:
          assert col.describe_null == (0, None)
      else:
          assert col.describe_null == (3, 0)
  
imports: from typing import Any, Tuple
  import cupy
  import pandas
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_150
  from cudf.core.buffer import as_buffer
  from cudf.core.column import as_column, build_column
  from cudf.core.df_protocol import DataFrameObject, _CuDFBuffer, _CuDFColumn, _DtypeKind, _MaskKind, _protocol_buffer_to_cudf_buffer, from_dataframe, protocol_dtype_to_cupy_dtype
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 4 for calling a global function with example usage: assert_column_equal(col, cudfcol) without return types