code: def test_object_casts_NULL_None_equivalence(self, dtype):
      # None to <other> casts may succeed or fail, but a NULL'ed array must
      # behave the same as one filled with None's.
      arr_normal = np.array([None] * 5)
      arr_NULLs = np.empty_like(arr_normal)
      ctypes.memset(arr_NULLs.ctypes.data, 0, arr_NULLs.nbytes)
      # If the check fails (maybe it should) the test would lose its purpose:
      assert arr_NULLs.tobytes() == b"\x00" * arr_NULLs.nbytes
  
      try:
          expected = arr_normal.astype(dtype)
      except TypeError:
          with pytest.raises(TypeError):
              arr_NULLs.astype(dtype),
      else:
          assert_array_equal(expected, arr_NULLs.astype(dtype))
  
imports: import pytest
  import textwrap
  import enum
  import random
  import ctypes
  import numpy
  from numpy.lib.stride_tricks import as_strided
  from numpy.testing import assert_array_equal
  from numpy.core._multiarray_umath import _get_castingimpl
label_desc: Use image node_id 19 for calling the TestCasting obj's underlying member method code with example usage: obj.test_object_casts_NULL_None_equivalence(dtype) without return types