code: def test_asanyarray(arr, like):
      if isinstance(like, np.ndarray) and isinstance(
          da.utils.meta_from_array(arr), cupy.ndarray
      ):
          with pytest.raises(TypeError):
              a = da.utils.asanyarray_safe(arr, like=like)
      else:
          a = da.utils.asanyarray_safe(arr, like=like)
          assert type(a) is type(like)
  
imports: from __future__ import annotations
  import numpy
  import pytest
  from packaging.version import parse
  import dask
  import dask.array
  from dask.array.utils import assert_eq
  from dask.sizeof import sizeof
label_desc: Use image node_id 3 for calling a global function with example usage: test_asanyarray(arr, like) without return types