code: def ndarray_dtype_to_dtype(dtype):
      if dtype == np.int32:
          return DType.INT32
  
      if dtype == np.float32:
          return DType.FLOAT32
  
      if dtype == np.uint8:
          return DType.UINT8
  
      invalidInputError(False, f"{dtype} is not supported")
  
imports: from collections import namedtuple
  from io import BytesIO
  import numpy
  from itertools import chain, islice
  from enum import Enum
  import json
  from bigdl.dllib.utils.log4Error import *
  from typing import Any, Dict, Iterator, List, Union, TYPE_CHECKING
label_desc: Use image node_id 1 for calling a global function with example usage: ndarray_dtype_to_dtype(dtype) and returns: DType, DType, DType