code: def np_dtype_to_tensor_dtype(np_dtype: np.dtype) -> int:
      """
      Convert a numpy's dtype to corresponding tensor type. It can be used while converting numpy arrays to tensors.
  
      :param np_dtype: numpy's data_type
      :return: TensorsProto's data_type
      """
      return cast(
          int,
          mapping._NP_TYPE_TO_TENSOR_TYPE[
              np_dtype
          ],  # pylint: disable=protected-access
      )
  
imports: import collections.abc
  import numbers
  import struct
  from cmath import isnan
  from typing import Any, Callable, Dict, KeysView, List, Optional, Sequence, Tuple, TypeVar, Union, cast
  import google.protobuf.message
  import numpy
  from onnx import IR_VERSION, AttributeProto, FunctionProto, GraphProto, MapProto, ModelProto, NodeProto, OperatorSetIdProto, OptionalProto, SequenceProto, SparseTensorProto, TensorProto, TensorShapeProto, TrainingInfoProto, TypeProto, ValueInfoProto, defs, mapping
label_desc: Use image node_id 48 for calling a global function with example usage: np_dtype_to_tensor_dtype(np_dtype) and returns: cast