class_docstr: A file object providing transparent LZMA (de)compression.
  
  An LZMAFile can act as a wrapper for an existing file object, or
  refer directly to a named file on disk.
  
  Note that LZMAFile provides a *binary* file interface - data read
  is returned as bytes, and data to be written must be given as bytes.
docstr: Write a bytes object to the file.
  
  Returns the number of uncompressed bytes written, which is
  always the length of data in bytes. Note that due to buffering,
  the file on disk may not reflect the data written until close()
  is called.
docstr_tok: ["Write","a","bytes","object","to","the","file",".","Returns","the","number","of","uncompressed","bytes","written",",","which","is","always","the","length","of","data","in","bytes",".","Note","that","due","to","buffering",",","the","file","on","disk","may","not","reflect","the","data","written","until","close","(",")","is","called","."]
code: def write(self, data):
      """Write a bytes object to the file.
  
      Returns the number of uncompressed bytes written, which is
      always the length of data in bytes. Note that due to buffering,
      the file on disk may not reflect the data written until close()
      is called.
      """
      self._check_can_write()
      if isinstance(data, (bytes, bytearray)):
          length = len(data)
      else:
          # accept any data that supports the buffer protocol
          data = memoryview(data)
          length = data.nbytes
  
      compressed = self._compressor.compress(data)
      self._fp.write(compressed)
      self._pos += length
      return length
  
imports: import builtins
  import io
  import os
  from _lzma import *
  from _lzma import _encode_filter_properties, _decode_filter_properties
  import _compression
label_desc: Use image node_id 12 for calling the LZMAFile obj's underlying member method code with example usage: obj.write(data) and returns: length