class_docstr: Reader for Mat4 files 
class_docstr_tok: ["Reader","for","Mat4","files"]
docstr: get variables from stream as dictionary
  
  Parameters
  ----------
  variable_names : None or str or sequence of str, optional
      variable name, or sequence of variable names to get from Mat file /
      file stream.  If None, then get all variables in file
docstr_tok: ["get","variables","from","stream","as","dictionary","Parameters","--","--","--","--","--","variable_names",":","None","or","str","or","sequence","of","str",",","optional","variable","name",",","or","sequence","of","variable","names","to","get","from","Mat","file","\/","file","stream",".","If","None",",","then","get","all","variables","in","file"]
code: def get_variables(self, variable_names=None):
      """get variables from stream as dictionary
  
      Parameters
      ----------
      variable_names : None or str or sequence of str, optional
          variable name, or sequence of variable names to get from Mat file /
          file stream.  If None, then get all variables in file
      """
      if isinstance(variable_names, string_types):
          variable_names = [variable_names]
      elif variable_names is not None:
          variable_names = list(variable_names)
      self.mat_stream.seek(0)
      # set up variable reader
      self.initialize_read()
      mdict = {}
      while not self.end_of_stream():
          hdr, next_position = self.read_var_header()
          name = asstr(hdr.name)
          if variable_names is not None and name not in variable_names:
              self.mat_stream.seek(next_position)
              continue
          mdict[name] = self.read_var_array(hdr)
          self.mat_stream.seek(next_position)
          if variable_names is not None:
              variable_names.remove(name)
              if len(variable_names) == 0:
                  break
      return mdict
  
imports: from __future__ import division, print_function, absolute_import
  import sys
  import warnings
  import numpy
  from numpy.compat import asbytes, asstr
  import scipy.sparse
  from scipy._lib.six import string_types
  from .miobase import MatFileReader, docfiller, matdims, read_dtype, convert_dtypes, arr_to_chars, arr_dtype_number
  from .mio_utils import squeeze_element, chars_to_strings
  from functools import reduce
label_desc: Use image node_id 6 for calling the MatFile4Reader obj's underlying member method code with example usage: obj.get_variables(variable_names) and returns: mdict