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

Method UnsetAll

deps/protobuf/python/stubout.py:131–143  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

129 setattr(parent, child_name, new_child)
130
131 def UnsetAll(self):
132 """Reverses all the Set() calls, restoring things to their original
133 definition. Its okay to call UnsetAll() repeatedly, as later calls have
134 no effect if no Set() calls have been made.
135
136 """
137 # Undo calls to Set() in reverse order, in case Set() was called on the
138 # same arguments repeatedly (want the original call to be last one undone)
139 self.cache.reverse()
140
141 for (parent, old_child, child_name) in self.cache:
142 setattr(parent, child_name, old_child)
143 self.cache = []

Callers 2

__del__Method · 0.95
UnsetStubsMethod · 0.80

Calls 2

setattrFunction · 0.85
reverseMethod · 0.80

Tested by

no test coverage detected