code: def _item_to_np_array(
      item, dtype: np.dtype, shape: Shape
  ) -> np.ndarray:
      """Single item to a np.array."""
      result = np.asanyarray(item, dtype=dtype)
      utils.assert_shape_match(result.shape, shape)
      if dtype_utils.is_string(dtype) and not _is_string(item):
          raise ValueError(
              f"Unsupported value: {result}\nCould not convert to bytes list."
          )
      return result
  
imports: from __future__ import annotations
  import abc
  import collections
  import dataclasses
  from typing import Any, Mapping, Union
  import numpy
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.utils import dtype_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.proto import tf_example_pb2
  from tensorflow_datasets.proto import tf_feature_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: _item_to_np_array(item, dtype, shape) and returns: result