class_docstr: Capture IO to/from a given os-level filedescriptor. 
docstr: unpatch and clean up, returns the self.tmpfile (file object)
          
docstr_tok: ["unpatch","and","clean","up",",","returns","the","self.tmpfile","(","file","object",")"]
code: def done(self):
      """unpatch and clean up, returns the self.tmpfile (file object)"""
      os.dup2(self._savefd, self.targetfd)
      os.close(self._savefd)
      if self.targetfd != 0:
          self.tmpfile.seek(0)
      if hasattr(self, "_oldsys"):
          setattr(sys, patchsysdict[self.targetfd], self._oldsys)
      return self.tmpfile
  
imports: import os
  import sys
  import py
  import tempfile
label_desc: Use image node_id 3 for calling the FDCapture obj's underlying member method code with example usage: obj.done() and returns: self