docstr: Patches the environment.
docstr_tok: ["Patches","the","environment","."]
code: def setUp(self):
      """Patches the environment."""
      super(PyPIRCCommandTestCase, self).setUp()
      self.tmp_dir = self.mkdtemp()
      os.environ["HOME"] = self.tmp_dir
      self.rc = os.path.join(self.tmp_dir, ".pypirc")
      self.dist = Distribution()
  
      class command(PyPIRCCommand):
          def __init__(self, dist):
              PyPIRCCommand.__init__(self, dist)
  
          def initialize_options(self):
              pass
  
          finalize_options = initialize_options
  
      self._cmd = command
      self.old_threshold = set_threshold(WARN)
  
imports: import sys
  import os
  import unittest
  import tempfile
  import shutil
  from distutils.core import PyPIRCCommand
  from distutils.core import Distribution
  from distutils.log import set_threshold
  from distutils.log import WARN
  from distutils.tests import support
  from test.test_support import run_unittest
label_desc: Use image node_id 1 for calling the PyPIRCCommandTestCase obj's underlying member method code with example usage: obj.setUp() without return types