class_docstr: Specification for the config-based bundle workflow.
  Standardized the `initialize`, `run`, `finalize` behavior in a config-based training, evaluation, or inference.
  Before `run`, we add bundle root directory to Python search directories automatically.
  For more information: https://docs.monai.io/en/latest/mb_specification.html.
  
  Args:
      config_file: filepath of the config file, if this is a list of file paths, their contents will be merged in order.
      meta_file: filepath of the metadata file, if this is a list of file paths, their contents will be merged in order.
          If None, default to "configs/metadata.json", which is commonly used for bundles in MONAI model zoo.
      logging_file: config file for `logging` module in the program. for more details:
          https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig.
          If None, default to "configs/logging.conf", which is commonly used for bundles in MONAI model zoo.
      init_id: ID name of the expected config expression to initialize before running, default to "initialize".
          allow a config to have no `initialize` logic and the ID.
      run_id: ID name of the expected config expression to run, default to "run".
          to run the config, the target config must contain this ID.
      final_id: ID name of the expected config expression to finalize after running, default to "finalize".
          allow a config to have no `finalize` logic and the ID.
      tracking: if not None, enable the experiment tracking at runtime with optionally configurable and extensible.
          if "mlflow", will add `MLFlowHandler` to the parsed bundle with default tracking settings,
          if other string, treat it as file path to load the tracking settings.
          if `dict`, treat it as tracking settings.
          will patch the target config content with `tracking handlers` and the top-level items of `configs`.
          for detailed usage examples, please check the tutorial:
          https://github.com/Project-MONAI/tutorials/blob/main/experiment_management/bundle_integrate_mlflow.ipynb.
      workflow_type: specifies the workflow type: "train" or "training" for a training workflow,
          or "infer", "inference", "eval", "evaluation" for a inference workflow,
          other unsupported string will raise a ValueError.
          default to `None` for common workflow.
      workflow: specifies the workflow type: "train" or "training" for a training workflow,
          or "infer", "inference", "eval", "evaluation" for a inference workflow,
          other unsupported string will raise a ValueError.
          default to `None` for common workflow.
      override: id-value pairs to override or add the corresponding config content.
          e.g. ``--net#input_chns 42``, ``--net %/data/other.json#net_arg``
class_docstr_tok: ["Specification","for","the","config-based","bundle","workflow",".","Standardized","the","`","initialize","`",",","`","run","`",",","`","finalize","`","behavior","in","a","config-based","training",",","evaluation",",","or","inference",".","Before","`","run","`",",","we","add","bundle","root","directory","to","Python","search","directories","automatically",".","For","more","information",":","https",":","\/\/docs.monai.io\/en\/latest\/mb_specification.html",".","Args",":","config_file",":","filepath","of","the","config","file",",","if","this","is","a","list","of","file","paths",",","their","contents","will","be","merged","in","order",".","meta_file",":","filepath","of","the","metadata","file",",","if","this","is","a","list","of","file","paths",",","their","contents","will","be","merged","in","order",".","If","None",",","default","to","``","configs\/metadata.json","''",",","which","is","commonly","used","for","bundles","in","MONAI","model","zoo",".","logging_file",":","config","file","for","`","logging","`","module","in","the","program",".","for","more","details",":","https",":","\/\/docs.python.org\/3\/library\/logging.config.html","#","logging.config.fileConfig",".","If","None",",","default","to","``","configs\/logging.conf","''",",","which","is","commonly","used","for","bundles","in","MONAI","model","zoo",".","init_id",":","ID","name","of","the","expected","config","expression","to","initialize","before","running",",","default","to","``","initialize","''",".","allow","a","config","to","have","no","`","initialize","`","logic","and","the","ID",".","run_id",":","ID","name","of","the","expected","config","expression","to","run",",","default","to","``","run","''",".","to","run","the","config",",","the","target","config","must","contain","this","ID",".","final_id",":","ID","name","of","the","expected","config","expression","to","finalize","after","running",",","default","to","``","finalize","''",".","allow","a","config","to","have","no","`","finalize","`","logic","and","the","ID",".","tracking",":","if","not","None",",","enable","the","experiment","tracking","at","runtime","with","optionally","configurable","and","extensible",".","if","``","mlflow","''",",","will","add","`","MLFlowHandler","`","to","the","parsed","bundle","with","default","tracking","settings",",","if","other","string",",","treat","it","as","file","path","to","load","the","tracking","settings",".","if","`","dict","`",",","treat","it","as","tracking","settings",".","will","patch","the","target","config","content","with","`","tracking","handlers","`","and","the","top-level","items","of","`","configs","`",".","for","detailed","usage","examples",",","please","check","the","tutorial",":","https",":","\/\/github.com\/Project-MONAI\/tutorials\/blob\/main\/experiment_management\/bundle_integrate_mlflow.ipynb",".","workflow_type",":","specifies","the","workflow","type",":","``","train","''","or","``","training","''","for","a","training","workflow",",","or","``","infer","''",",","``","inference","''",",","``","eval","''",",","``","evaluation","''","for","a","inference","workflow",",","other","unsupported","string","will","raise","a","ValueError",".","default","to","`","None","`","for","common","workflow",".","workflow",":","specifies","the","workflow","type",":","``","train","''","or","``","training","''","for","a","training","workflow",",","or","``","infer","''",",","``","inference","''",",","``","eval","''",",","``","evaluation","''","for","a","inference","workflow",",","other","unsupported","string","will","raise","a","ValueError",".","default","to","`","None","`","for","common","workflow",".","override",":","id-value","pairs","to","override","or","add","the","corresponding","config","content",".","e.g",".","``","--","net","#","input_chns","42","``",",","``","--","net","%","\/data\/other.json","#","net_arg","``"]
code: def __init__(
      self,
      config_file: str | Sequence[str],
      meta_file: str | Sequence[str] | None = None,
      logging_file: str | None = None,
      init_id: str = "initialize",
      run_id: str = "run",
      final_id: str = "finalize",
      tracking: str | dict | None = None,
      workflow_type: str | None = None,
      workflow: str | None = None,
      **override: Any,
  ) -> None:
      workflow_type = (
          workflow if workflow is not None else workflow_type
      )
      super().__init__(workflow_type=workflow_type)
      if config_file is not None:
          _config_files = ensure_tuple(config_file)
          self.config_root_path = Path(_config_files[0]).parent
          for _config_file in _config_files:
              _config_file = Path(_config_file)
              if _config_file.parent != self.config_root_path:
                  logger.warn(
                      f"Not all config files are in {self.config_root_path}. If logging_file and meta_file are"
                      f"not specified, {self.config_root_path} will be used as the default config root directory."
                  )
              if not _config_file.is_file():
                  raise FileNotFoundError(
                      f"Cannot find the config file: {_config_file}."
                  )
      else:
          self.config_root_path = Path("configs")
  
      logging_file = (
          str(self.config_root_path / "logging.conf")
          if logging_file is None
          else logging_file
      )
      if logging_file is not None:
          if not os.path.exists(logging_file):
              if logging_file == str(
                  self.config_root_path / "logging.conf"
              ):
                  logger.warn(
                      f"Default logging file in {logging_file} does not exist, skipping logging."
                  )
              else:
                  raise FileNotFoundError(
                      f"Cannot find the logging config file: {logging_file}."
                  )
          else:
              logger.info(
                  f"Setting logging properties based on config: {logging_file}."
              )
              fileConfig(logging_file, disable_existing_loggers=False)
  
      self.parser = ConfigParser()
      self.parser.read_config(f=config_file)
      meta_file = (
          str(self.config_root_path / "metadata.json")
          if meta_file is None
          else meta_file
      )
      if isinstance(meta_file, str) and not os.path.exists(meta_file):
          logger.error(
              f"Cannot find the metadata config file: {meta_file}. "
              "Please see: https://docs.monai.io/en/stable/mb_specification.html"
          )
      else:
          self.parser.read_meta(f=meta_file)
  
      # the rest key-values in the _args are to override config content
      self.parser.update(pairs=override)
      self.init_id = init_id
      self.run_id = run_id
      self.final_id = final_id
      # set tracking configs for experiment management
      if tracking is not None:
          if (
              isinstance(tracking, str)
              and tracking in DEFAULT_EXP_MGMT_SETTINGS
          ):
              settings_ = DEFAULT_EXP_MGMT_SETTINGS[tracking]
          else:
              settings_ = ConfigParser.load_config_files(tracking)
          self.patch_bundle_tracking(
              parser=self.parser, settings=settings_
          )
      self._is_initialized: bool = False
  
imports: from __future__ import annotations
  import os
  import sys
  import time
  from abc import ABC, abstractmethod
  from copy import copy
  from logging.config import fileConfig
  from pathlib import Path
  from typing import Any, Sequence
  from monai.apps.utils import get_logger
  from monai.bundle.config_parser import ConfigParser
  from monai.bundle.properties import InferProperties, MetaProperties, TrainProperties
  from monai.bundle.utils import DEFAULT_EXP_MGMT_SETTINGS, EXPR_KEY, ID_REF_KEY, ID_SEP_KEY
  from monai.utils import BundleProperty, BundlePropertyConfig, deprecated_arg, deprecated_arg_default, ensure_tuple
label_desc: Use image node_id 1 to create a new ConfigWorkflow object from inherited base classes: BundleWorkflow with example: obj = ConfigWorkflow(config_file, meta_file, logging_file, init_id, run_id, final_id, tracking, workflow_type, workflow)