class_docstr: A class to duplicate an output stream to stdout/err.
  
  This works in a manner very similar to the Unix 'tee' command.
  
  When the object is closed or deleted, it closes the original file given to
  it for duplication.
docstr: Close the file and restore the channel.
docstr_tok: ["Close","the","file","and","restore","the","channel","."]
code: def close(self):
      """Close the file and restore the channel."""
      self.flush()
      setattr(sys, self.channel, self.ostream)
      self.file.close()
      self._closed = True
  
imports: from __future__ import print_function
  from __future__ import absolute_import
  import atexit
  import os
  import sys
  import tempfile
  import warnings
  from warnings import warn
  from IPython.utils.decorators import undoc
  from .capture import CapturedIO, capture_output
  from .py3compat import string_types, input, PY3
label_desc: Use image node_id 2 for calling the Tee obj's underlying member method code with example usage: obj.close() without return types