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

Function has_option

monai/utils/misc.py:588–595  ·  view source on GitHub ↗

Return a boolean indicating whether the given callable `obj` has the `keywords` in its signature.

(obj: Callable, keywords: str | Sequence[str])

Source from the content-addressed store, hash-verified

586
587
588def has_option(obj: Callable, keywords: str | Sequence[str]) -> bool:
589 """
590 Return a boolean indicating whether the given callable `obj` has the `keywords` in its signature.
591 """
592 if not callable(obj):
593 return False
594 sig = inspect.signature(obj)
595 return all(key in sig.parameters for key in ensure_tuple(keywords))
596
597
598def is_module_ver_at_least(module, version):

Callers 5

__init__Method · 0.90
__init__Method · 0.90
get_norm_layerFunction · 0.90

Calls 1

ensure_tupleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…