class_docstr: A file object providing transparent bzip2 (de)compression.
  
  A BZ2File can act as a wrapper for an existing file object, or refer
  directly to a named file on disk.
  
  Note that BZ2File provides a *binary* file interface - data read is
  returned as bytes, and data to be written should be given as bytes.
class_docstr_tok: ["A","file","object","providing","transparent","bzip2","(","de",")","compression",".","A","BZ2File","can","act","as","a","wrapper","for","an","existing","file","object",",","or","refer","directly","to","a","named","file","on","disk",".","Note","that","BZ2File","provides","a","*","binary","*","file","interface","-","data","read","is","returned","as","bytes",",","and","data","to","be","written","should","be","given","as","bytes","."]
docstr: Flush and close the file.
  
  May be called more than once without error. Once the file is
  closed, any other operation on it will raise a ValueError.
docstr_tok: ["Flush","and","close","the","file",".","May","be","called","more","than","once","without","error",".","Once","the","file","is","closed",",","any","other","operation","on","it","will","raise","a","ValueError","."]
code: def close(self):
      """Flush and close the file.
  
      May be called more than once without error. Once the file is
      closed, any other operation on it will raise a ValueError.
      """
      if self._mode == _MODE_CLOSED:
          return
      try:
          if self._mode == _MODE_READ:
              self._buffer.close()
          elif self._mode == _MODE_WRITE:
              self._fp.write(self._compressor.flush())
              self._compressor = None
      finally:
          try:
              if self._closefp:
                  self._fp.close()
          finally:
              self._fp = None
              self._closefp = False
              self._mode = _MODE_CLOSED
              self._buffer = None
  
imports: from builtins import open
  import io
  import os
  import _compression
  from _bz2 import BZ2Compressor, BZ2Decompressor
label_desc: Use image node_id 2 for calling the BZ2File obj's underlying member method code with example usage: obj.close() without return types