code: def read_dtype(mat_stream, a_dtype):
      """
      Generic get of byte stream data of known type
  
      Parameters
      ----------
      mat_stream : file_like object
          MATLAB (tm) mat file stream
      a_dtype : dtype
          dtype of array to read.  `a_dtype` is assumed to be correct
          endianness.
  
      Returns
      -------
      arr : ndarray
          Array of dtype `a_dtype` read from stream.
  
      """
      num_bytes = a_dtype.itemsize
      arr = np.ndarray(
          shape=(),
          dtype=a_dtype,
          buffer=mat_stream.read(num_bytes),
          order="F",
      )
      return arr
  
imports: from __future__ import division, print_function, absolute_import
  import sys
  import operator
  from scipy._lib.six import reduce
  import numpy
  from scipy.misc import doccer
  from .None import byteordercodes
label_desc: Use image node_id 2 for calling a global function with example usage: read_dtype(mat_stream, a_dtype) and returns: arr