parameters: (self, arr, name)
docstring: Write matrix `arr`, with name `name`
  
          Parameters
          ----------
          arr : array_like
             array to write
          name : str
             name in matlab workspace
docstring_summary: Write matrix `arr`, with name `name`
docstring_tokens: Write matrix arr with name name
function: def write(self, arr, name):
          ''' Write matrix `arr`, with name `name`
  
          Parameters
          ----------
          arr : array_like
             array to write
          name : str
             name in matlab workspace
          '''
          # we need to catch sparse first, because np.asarray returns an
          # an object array for scipy.sparse
          if scipy.sparse.issparse(arr):
              self.write_sparse(arr, name)
              return
          arr = np.asarray(arr)
          dt = arr.dtype
          if not dt.isnative:
              arr = arr.astype(dt.newbyteorder('='))
          dtt = dt.type
          if dtt is np.object_:
              raise TypeError('Cannot save object arrays in Mat4')
          elif dtt is np.void:
              raise TypeError('Cannot save void type arrays')
          elif dtt in (np.unicode_, np.string_):
              self.write_char(arr, name)
              return
          self.write_numeric(arr, name)
function_tokens: def write ( self , arr , name ) : # we need to catch sparse first, because np.asarray returns an # an object array for scipy.sparse if scipy . sparse . issparse ( arr ) : self . write_sparse ( arr , name ) return arr = np . asarray ( arr ) dt = arr . dtype if not dt . isnative : arr = arr . astype ( dt . newbyteorder ( '=' ) ) dtt = dt . type if dtt is np . object_ : raise TypeError ( 'Cannot save object arrays in Mat4' ) elif dtt is np . void : raise TypeError ( 'Cannot save void type arrays' ) elif dtt in ( np . unicode_ , np . string_ ) : self . write_char ( arr , name ) return self . write_numeric ( arr , name )