docstr: Replace stdout and stderr to specified stream.
docstr_tok: ["Replace","stdout","and","stderr","to","specified","stream","."]
code: def __enter__(self):
      """
      Replace stdout and stderr to specified stream.
      """
      sys.stdout.flush()
      sys.stderr.flush()
      self.old_stdout_fileno, self.old_stderr_fileno = os.dup(
          sys.stdout.fileno()
      ), os.dup(sys.stderr.fileno())
      os.dup2(self._stdout.fileno(), sys.stdout.fileno())
      os.dup2(self._stderr.fileno(), sys.stderr.fileno())
  
imports: import collections
  import os
  import sys
label_desc: Use image node_id 2 for calling the RedirectStdStreams obj's underlying member method code with example usage: obj.__enter__() without return types