MCPcopy Create free account
hub / github.com/VisionRush/DeepFakeDefenders / _immutable

Method _immutable

toolkit/yacs.py:260–271  ·  view source on GitHub ↗

Set immutability to is_immutable and recursively apply the setting to all nested CfgNodes.

(self, is_immutable)

Source from the content-addressed store, hash-verified

258 return self.__dict__[CfgNode.IMMUTABLE]
259
260 def _immutable(self, is_immutable):
261 """Set immutability to is_immutable and recursively apply the setting
262 to all nested CfgNodes.
263 """
264 self.__dict__[CfgNode.IMMUTABLE] = is_immutable
265 # Recursively set immutable state
266 for v in self.__dict__.values():
267 if isinstance(v, CfgNode):
268 v._immutable(is_immutable)
269 for v in self.values():
270 if isinstance(v, CfgNode):
271 v._immutable(is_immutable)
272
273 def clone(self):
274 """Recursively copy this CfgNode."""

Callers 2

freezeMethod · 0.95
defrostMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected