code: def test_from_sample_ensure_not_override():
      example = NumpyNdarray.from_sample(
          np.ones((2, 2, 3)), dtype=np.float32
      )
      assert example._dtype == np.float32
  
      example = NumpyNdarray.from_sample(
          np.ones((2, 2, 3)), shape=(2, 2, 3)
      )
      assert example._shape == (2, 2, 3)
  
imports: from __future__ import annotations
  import logging
  from functools import partial
  from typing import TYPE_CHECKING
  import numpy
  import pytest
  from bentoml._internal.service.openapi.specification import Schema
  from bentoml.exceptions import BadInput
  from bentoml.exceptions import BentoMLException
  from bentoml.grpc.utils import import_generated_stubs
  from bentoml.io import NumpyNdarray
label_desc: Use image node_id 8 for calling a global function with example usage: test_from_sample_ensure_not_override() without return types