MCPcopy Create free account
hub / github.com/apple/coremltools / SmartUnsetAll

Method SmartUnsetAll

deps/protobuf/python/stubout.py:99–110  ·  view source on GitHub ↗

Reverses all the SmartSet() calls, restoring things to their original definition. Its okay to call SmartUnsetAll() repeatedly, as later calls have no effect if no SmartSet() calls have been made.

(self)

Source from the content-addressed store, hash-verified

97 setattr(orig_obj, attr_name, new_attr)
98
99 def SmartUnsetAll(self):
100 """Reverses all the SmartSet() calls, restoring things to their original
101 definition. Its okay to call SmartUnsetAll() repeatedly, as later calls
102 have no effect if no SmartSet() calls have been made.
103
104 """
105 self.stubs.reverse()
106
107 for args in self.stubs:
108 setattr(*args)
109
110 self.stubs = []
111
112 def Set(self, parent, child_name, new_child):
113 """Replace child_name's old definition with new_child, in the context

Callers 1

__del__Method · 0.95

Calls 2

setattrFunction · 0.85
reverseMethod · 0.80

Tested by

no test coverage detected