class_docstr: Support class for stubbing methods out for unit testing.
  
  Sample Usage:
  
  You want os.path.exists() to always return true during testing.
  
     stubs = StubOutForTesting()
     stubs.Set(os.path, 'exists', lambda x: 1)
       ...
     stubs.CleanUp()
  
  The above changes os.path.exists into a lambda that returns 1.  Once
  the ... part of the code finishes, the CleanUp() looks up the old
  value of os.path.exists and restores it.
class_docstr_tok: ["Support","class","for","stubbing","methods","out","for","unit","testing",".","Sample","Usage",":","You","want","os.path.exists","(",")","to","always","return","true","during","testing",".","stubs","=","StubOutForTesting","(",")","stubs.Set","(","os.path",",","'exists","'",",","lambda","x",":","1",")","...","stubs.CleanUp","(",")","The","above","changes","os.path.exists","into","a","lambda","that","returns","1",".","Once","the","...","part","of","the","code","finishes",",","the","CleanUp","(",")","looks","up","the","old","value","of","os.path.exists","and","restores","it","."]
docstr: Undoes all SmartSet() & Set() calls, restoring original definitions.
docstr_tok: ["Undoes","all","SmartSet","(",")","&","Set","(",")","calls",",","restoring","original","definitions","."]
code: def CleanUp(self):
      """Undoes all SmartSet() & Set() calls, restoring original definitions."""
      self.SmartUnsetAll()
      self.UnsetAll()
  
imports: import atexit
  import os
  import sys
  import tempfile
  from absl import app
  from absl.testing.absltest import *
  from tensorflow.python.framework import errors
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.platform import benchmark
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import tf_decorator
  from tensorflow.python.util import tf_inspect
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 5 for calling the StubOutForTesting obj's underlying member method code with example usage: obj.CleanUp() without return types