class_docstr: Generic matlab matrix writing class 
docstr: Write variable at top level of mat file
  
  Parameters
  ----------
  arr : array_like
      array-like object to create writer for
  name : str, optional
      name as it will appear in matlab workspace
      default is empty string
  is_global : {False, True}, optional
      whether variable will be global on load into matlab
docstr_tok: ["Write","variable","at","top","level","of","mat","file","Parameters","--","--","--","--","--","arr",":","array_like","array-like","object","to","create","writer","for","name",":","str",",","optional","name","as","it","will","appear","in","matlab","workspace","default","is","empty","string","is_global",":","{","False",",","True","}",",","optional","whether","variable","will","be","global","on","load","into","matlab"]
code: def write_top(self, arr, name, is_global):
      """Write variable at top level of mat file
  
      Parameters
      ----------
      arr : array_like
          array-like object to create writer for
      name : str, optional
          name as it will appear in matlab workspace
          default is empty string
      is_global : {False, True}, optional
          whether variable will be global on load into matlab
      """
      # these are set before the top-level header write, and unset at
      # the end of the same write, because they do not apply for lower levels
      self._var_is_global = is_global
      self._var_name = name
      # write the header and data
      self.write(arr)
  
imports: import os
  import time
  import sys
  import zlib
  from io import BytesIO
  import warnings
  import numpy
  import scipy.sparse
  from ._byteordercodes import native_code, swapped_code
  from ._miobase import MatFileReader, docfiller, matdims, read_dtype, arr_to_chars, arr_dtype_number, MatWriteError, MatReadError, MatReadWarning
  from ._mio5_utils import VarReader5
  from ._mio5_params import MatlabObject, MatlabFunction, MDTYPES, NP_TO_MTYPES, NP_TO_MXTYPES, miCOMPRESSED, miMATRIX, miINT8, miUTF8, miUINT32, mxCELL_CLASS, mxSTRUCT_CLASS, mxOBJECT_CLASS, mxCHAR_CLASS, mxSPARSE_CLASS, mxDOUBLE_CLASS, mclass_info, mat_struct
  from ._streams import ZlibInputStream
label_desc: Use image node_id 9 for calling the VarWriter5 obj's underlying member method code with example usage: obj.write_top(arr, name, is_global) without return types