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: Reverses SmartSet() calls, restoring things to original definitions.
  
  This method is automatically called when the StubOutForTesting()
  object is deleted; there is no need to call it explicitly.
  
  It is okay to call SmartUnsetAll() repeatedly, as later calls have
  no effect if no SmartSet() calls have been made.
docstr_tok: ["Reverses","SmartSet","(",")","calls",",","restoring","things","to","original","definitions",".","This","method","is","automatically","called","when","the","StubOutForTesting","(",")","object","is","deleted",";","there","is","no","need","to","call","it","explicitly",".","It","is","okay","to","call","SmartUnsetAll","(",")","repeatedly",",","as","later","calls","have","no","effect","if","no","SmartSet","(",")","calls","have","been","made","."]
code: def SmartUnsetAll(self):
      """Reverses SmartSet() calls, restoring things to original definitions.
  
      This method is automatically called when the StubOutForTesting()
      object is deleted; there is no need to call it explicitly.
  
      It is okay to call SmartUnsetAll() repeatedly, as later calls have
      no effect if no SmartSet() calls have been made.
      """
      for args in reversed(self.stubs):
          setattr(*args)
  
      self.stubs = []
  
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 7 for calling the StubOutForTesting obj's underlying member method code with example usage: obj.SmartUnsetAll() without return types