code: def cleanup(self):
          
          for path in self.paths:
              if isinstance(path, tuple):
                  os.close(path[0])
                  os.unlink(path[1])
              else:
                  shutil.rmtree(path)
          self.paths = []
docs: Remove any created temp paths