code: def patch_hydra(cls):
      # noinspection PyBroadException
      try:
          # only once
          if cls._original_run_job:
              return True
          # if hydra is not loaded, do not patch anything
          if not sys.modules.get("hydra"):
              return False
  
          from hydra._internal import hydra as internal_hydra  # noqa
          from hydra.core import utils as utils_hydra  # noqa
          from hydra._internal.core_plugins import (
              basic_launcher,
          )  # noqa
  
          cls._original_hydra_run = internal_hydra.Hydra.run
          internal_hydra.Hydra.run = cls._patched_hydra_run
  
          cls._original_run_job = utils_hydra.run_job
          utils_hydra.run_job = cls._patched_run_job
          internal_hydra.run_job = cls._patched_run_job
          basic_launcher.run_job = cls._patched_run_job
          return True
      except Exception:
          return False
  
file_path: clearml/clearml/binding/hydra_bind.py
imports: import io
  import sys
  from functools import partial
  from ..config import running_remotely, get_remote_task_id, DEV_TASK_NO_REUSE
  from ..debugging.log import LoggerRoot
label_desc: Use image node_id 1 for calling the PatchHydra obj's underlying member method code with example usage: obj.patch_hydra(cls) and returns: True, True, False, False