code: def test_meta_from_array(asarray):
      x = np.array(1)
      assert meta_from_array(x, ndim=1).shape == (0,)
  
      x = np.ones((1, 2, 3), dtype="float32")
      x = asarray(x)
  
      assert meta_from_array(x).shape == (0, 0, 0)
      assert meta_from_array(x).dtype == "float32"
      assert type(meta_from_array(x)) is type(x)
  
      assert meta_from_array(x, ndim=2).shape == (0, 0)
      assert meta_from_array(x, ndim=4).shape == (0, 0, 0, 0)
      assert meta_from_array(x, dtype="float64").dtype == "float64"
      assert meta_from_array(x, dtype=float).dtype == "float64"
  
      x = da.ones((1,))
      assert isinstance(meta_from_array(x), np.ndarray)
  
      assert meta_from_array(123) == 123
      assert meta_from_array("foo") == "foo"
      assert meta_from_array(np.dtype("float32")) == np.dtype("float32")
  
file_path: dask/dask/array/tests/test_array_utils.py
imports: from __future__ import annotations
  import numpy
  import pytest
  import dask.array
  from dask.array.core import Array
  from dask.array.utils import assert_eq, meta_from_array
  from dask.local import get_sync
label_desc: Use image node_id 1 for calling a global function with example usage: test_meta_from_array(asarray) without return types