class_docstr: A test result class that can express test results in a XML report.
  
  Used by XMLTestRunner.
docstr: Replace the stdout and stderr streams with string-based streams
  in order to capture the tests' output.
docstr_tok: ["Replace","the","stdout","and","stderr","streams","with","string-based","streams","in","order","to","capture","the","tests","'","output","."]
code: def _patch_standard_output(self):
      """Replace the stdout and stderr streams with string-based streams
      in order to capture the tests' output.
      """
      if not self.output_patched:
          (self.old_stdout, self.old_stderr) = (sys.stdout, sys.stderr)
          self.output_patched = True
      (sys.stdout, sys.stderr) = (self.stdout, self.stderr) = (
          StringIO(),
          StringIO(),
      )
  
imports: from __future__ import absolute_import
  import os
  import sys
  import time
  from unittest import TestResult, TextTestResult, TextTestRunner
  import xml.dom.minidom
label_desc: Use image node_id 3 for calling the _XMLTestResult obj's underlying member method code with example usage: obj._patch_standard_output() without return types