code: def assert_column_array_dtype_equal(
      column: ColumnBase, array: pa.array
  ):
      """
      In cudf, each column holds its dtype. And since column may have child
      columns, child columns also holds their datatype. This method tests
      that every level of `column` matches the type of the given `array`
      recursively.
      """
  
      if isinstance(column.dtype, ListDtype):
          return array.type.equals(
              column.dtype.to_arrow()
          ) and assert_column_array_dtype_equal(
              column.base_children[1], array.values
          )
      elif isinstance(column.dtype, StructDtype):
          return array.type.equals(column.dtype.to_arrow()) and all(
              assert_column_array_dtype_equal(child, array.field(i))
              for i, child in enumerate(column.base_children)
          )
      elif isinstance(
          column.dtype,
          (Decimal128Dtype, Decimal64Dtype, Decimal32Dtype),
      ):
          return array.type.equals(column.dtype.to_arrow())
      elif isinstance(column.dtype, CategoricalDtype):
          raise NotImplementedError()
      else:
          return array.type.equals(np_to_pa_dtype(column.dtype))
  
imports: import numpy
  import pandas
  import pyarrow
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_150
  from cudf.core.column import ColumnBase
  from cudf.core.dtypes import CategoricalDtype, Decimal32Dtype, Decimal64Dtype, Decimal128Dtype, IntervalDtype, ListDtype, StructDtype
  from cudf.testing._utils import assert_eq
  from cudf.utils.dtypes import np_to_pa_dtype
label_desc: Use image node_id 16 for calling a global function with example usage: assert_column_array_dtype_equal(column, array) and returns: unknown, unknown, array, array