code: def _check_to_numpy(a_np, a_chx, device, copy):
      chainerx.testing.assert_array_equal_ex(
          a_chx, a_np, strides_check=False
      )
      if a_np.size > 0:
          # test buffer is shared or not
          a_np.fill(1)
          expected = not copy and device.backend.name == "native"
          actual = numpy.array_equal(a_np, chainerx.to_numpy(a_chx))
          assert expected == actual
  
imports: import copy
  import math
  import pickle
  import numpy
  import pytest
  import chainerx
  import chainerx.testing
  from chainerx_tests import array_utils
label_desc: Use image node_id 7 for calling a global function with example usage: _check_to_numpy(a_np, a_chx, device, copy) without return types