MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / is_immutable

Function is_immutable

monai/utils/misc.py:157–163  ·  view source on GitHub ↗

Determine if the object is an immutable object. see also https://github.com/python/cpython/blob/3.11/Lib/copy.py#L109

(obj: Any)

Source from the content-addressed store, hash-verified

155
156
157def is_immutable(obj: Any) -> bool:
158 """
159 Determine if the object is an immutable object.
160
161 see also https://github.com/python/cpython/blob/3.11/Lib/copy.py#L109
162 """
163 return isinstance(obj, (type(None), int, float, bool, complex, str, tuple, bytes, type, range, slice))
164
165
166def ensure_tuple(vals: Any, wrap_array: bool = False) -> tuple:

Callers 1

copy_itemsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…