MCPcopy Index your code
hub / github.com/Project-MONAI/MONAI / issequenceiterable

Function issequenceiterable

monai/utils/misc.py:145–154  ·  view source on GitHub ↗

Determine if the object is an iterable sequence and is not a string.

(obj: Any)

Source from the content-addressed store, hash-verified

143
144
145def issequenceiterable(obj: Any) -> bool:
146 """
147 Determine if the object is an iterable sequence and is not a string.
148 """
149 try:
150 if hasattr(obj, "ndim") and obj.ndim == 0:
151 return False # a 0-d tensor is not iterable
152 except Exception:
153 return False
154 return isinstance(obj, Iterable) and not isinstance(obj, (str, bytes))
155
156
157def is_immutable(obj: Any) -> bool:

Callers 8

__init__Method · 0.90
__init__Method · 0.90
allow_missing_keys_modeFunction · 0.90
_get_rand_paramMethod · 0.90
ensure_tupleFunction · 0.85
ensure_tuple_repFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…