parameters: (fobj)
docstring: Return a buffered version of a write file object.
docstring_summary: Return a buffered version of a write file object.
docstring_tokens: Return a buffered version of a write file object .
function: def _buffered_write_file(fobj):
      """Return a buffered version of a write file object."""
      if PY26 or (PY27 and isinstance(fobj, bz2.BZ2File)):
          # Python 2.6 doesn't fully support io.BufferedWriter.
          # Python 2.7 doesn't work with BZ2File through a buffer: no attribute
          # 'writable'.
          # BZ2File doesn't implement the file object context manager in python 2
          # so we wrap the fileobj using `closing`.
          return closing(fobj)
      else:
          return io.BufferedWriter(fobj, buffer_size=_IO_BUFFER_SIZE)
function_tokens: def _buffered_write_file ( fobj ) : if PY26 or ( PY27 and isinstance ( fobj , bz2 . BZ2File ) ) : # Python 2.6 doesn't fully support io.BufferedWriter. # Python 2.7 doesn't work with BZ2File through a buffer: no attribute # 'writable'. # BZ2File doesn't implement the file object context manager in python 2 # so we wrap the fileobj using `closing`. return closing ( fobj ) else : return io . BufferedWriter ( fobj , buffer_size = _IO_BUFFER_SIZE )