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

Method __init__

monai/bundle/config_parser.py:301–320  ·  view source on GitHub ↗
(
        self,
        config: Any = None,
        excludes: Sequence[str] | str | None = None,
        globals: dict[str, Any] | None | bool = None,
    )

Source from the content-addressed store, hash-verified

299 meta_key = "_meta_" # field key to save metadata
300
301 def __init__(
302 self,
303 config: Any = None,
304 excludes: Sequence[str] | str | None = None,
305 globals: dict[str, Any] | None | bool = None,
306 ):
307 self.config: ConfigItem | None = None
308 self.globals: dict[str, Any] = {}
309 _globals = _default_globals.copy()
310 if isinstance(_globals, dict) and globals not in (None, False):
311 _globals.update(globals) # type: ignore
312 if _globals is not None and globals is not False:
313 for k, v in _globals.items():
314 self.globals[k] = optional_import(v)[0] if isinstance(v, str) else v
315
316 self.locator = ComponentLocator(excludes=excludes)
317 self.ref_resolver = ReferenceResolver()
318 if config is None:
319 config = {self.meta_key: {}}
320 self.set(config=self.ref_resolver.normalize_meta_id(config))
321
322 def __repr__(self):
323 return f"{self.config}"

Callers

nothing calls this directly

Calls 6

setMethod · 0.95
optional_importFunction · 0.90
ComponentLocatorClass · 0.90
ReferenceResolverClass · 0.90
normalize_meta_idMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected