code: def test_to_numpy():
      arr = NumpyExtensionArray(np.array([1, 2, 3]))
      result = arr.to_numpy()
      assert result is arr._ndarray
  
      result = arr.to_numpy(copy=True)
      assert result is not arr._ndarray
  
      result = arr.to_numpy(dtype="f8")
      expected = np.array([1, 2, 3], dtype="f8")
      tm.assert_numpy_array_equal(result, expected)
  
imports: import numpy
  import pytest
  from pandas.core.dtypes.dtypes import NumpyEADtype
  import pandas
  import pandas._testing
  from pandas.arrays import NumpyExtensionArray
label_desc: Use image node_id 13 for calling a global function with example usage: test_to_numpy() without return types