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

Function _wrapper

monai/utils/module.py:474–483  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

472
473 @wraps(call_obj)
474 def _wrapper(*args, **kwargs):
475 _, has = optional_import(module=pkg_name, version=version, version_checker=version_checker)
476 if not has:
477 err_msg = f"required package `{pkg_name}` is not installed or the version doesn't match requirement."
478 if raise_error:
479 raise OptionalImportError(err_msg)
480 else:
481 warnings.warn(err_msg)
482
483 return call_obj(*args, **kwargs)
484
485 if is_func:
486 return _wrapper

Callers

nothing calls this directly

Calls 2

optional_importFunction · 0.85
OptionalImportErrorClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…