code: def test_asarray_copy():
      a = asarray([1])
      b = asarray(a, copy=True)
      a[0] = 0
      assert all(b[0] == 1)
      assert all(a[0] == 0)
      a = asarray([1])
      b = asarray(a, copy=np._CopyMode.ALWAYS)
      a[0] = 0
      assert all(b[0] == 1)
      assert all(a[0] == 0)
      a = asarray([1])
      b = asarray(a, copy=np._CopyMode.NEVER)
      a[0] = 0
      assert all(b[0] == 0)
      assert_raises(NotImplementedError, lambda: asarray(a, copy=False))
      assert_raises(
          NotImplementedError,
          lambda: asarray(a, copy=np._CopyMode.IF_NEEDED),
      )
  
file_path: numpy/numpy/array_api/tests/test_creation_functions.py
imports: from numpy.testing import assert_raises
  import numpy
  from ..None import all
  from .._creation_functions import asarray, arange, empty, empty_like, eye, full, full_like, linspace, meshgrid, ones, ones_like, zeros, zeros_like
  from .._dtypes import float32, float64
  from .._array_object import Array
label_desc: Use image node_id 2 for calling a global function with example usage: test_asarray_copy() without return types