code: def test_from_numpy(ray_start_regular_shared, from_ref):
      arr1 = np.expand_dims(np.arange(0, 4), axis=1)
      arr2 = np.expand_dims(np.arange(4, 8), axis=1)
      arrs = [arr1, arr2]
      if from_ref:
          ds = ray.data.from_numpy_refs([ray.put(arr) for arr in arrs])
      else:
          ds = ray.data.from_numpy(arrs)
      values = np.stack(extract_values("data", ds.take(8)))
      np.testing.assert_array_equal(
          values, np.concatenate((arr1, arr2))
      )
      # Check that conversion task is included in stats.
      assert "FromNumpy" in ds.stats()
  
      # Test from single NumPy ndarray.
      if from_ref:
          ds = ray.data.from_numpy_refs(ray.put(arr1))
      else:
          ds = ray.data.from_numpy(arr1)
      values = np.stack(extract_values("data", ds.take(4)))
      np.testing.assert_array_equal(values, arr1)
      # Check that conversion task is included in stats.
      assert "FromNumpy" in ds.stats()
  
imports: import os
  import numpy
  import pandas
  import pyarrow
  import pytest
  from pytest_lazyfixture import lazy_fixture
  import ray
  from ray.data.datasource import BaseFileMetadataProvider, FastFileMetadataProvider, Partitioning, PartitionStyle, PathPartitionFilter
  from ray.data.tests.conftest import *
  from ray.data.tests.mock_http_server import *
  from ray.data.tests.test_partitioning import PathPartitionEncoder
  from ray.data.tests.util import Counter, extract_values
  from ray.tests.conftest import *
label_desc: Use image node_id 2 for calling a global function with example usage: test_from_numpy(ray_start_regular_shared, from_ref) without return types