* Mapping of extranetworks through the new command. This allows you to use a "virtual" extranetwork that is converted to a real one depending on conditions, like the model kind/variant. * Fixed a parsing bug with the if command. * Some refactoring and additional checks.
18 lines
472 B
Python
18 lines
472 B
Python
def deep_freeze(obj):
|
|
"""
|
|
Deep freeze an object.
|
|
|
|
Args:
|
|
obj (object): The object to freeze.
|
|
|
|
Returns:
|
|
object: The frozen object.
|
|
"""
|
|
if isinstance(obj, dict):
|
|
return tuple((k, deep_freeze(v)) for k, v in sorted(obj.items()))
|
|
if isinstance(obj, list):
|
|
return tuple(deep_freeze(i) for i in obj)
|
|
if isinstance(obj, set):
|
|
return tuple(deep_freeze(i) for i in sorted(obj))
|
|
return obj
|