code: def lsf_and_jsrun(lsf_exists, jsrun_installed):
      """
      Patches the lsf.LSFUtils.using_lsf and is_jsrun_installed methods called from
      horovod.runner.run.run_controller to return the given booleans.
      :param lsf_exists: boolean returned by lsf.LSFUtils.using_lsf
      :param jsrun_installed: boolean returned by is_jsrun_installed
      :return: mocked methods
      """
      with mock.patch(
          "horovod.runner.launch.lsf.LSFUtils.using_lsf",
          return_value=lsf_exists,
      ) as u:
          with mock.patch(
              "horovod.runner.launch.is_jsrun_installed",
              return_value=jsrun_installed,
          ) as i:
              yield u, i
  
imports: import contextlib
  import multiprocessing
  import os
  import shutil
  import sys
  import tempfile
  import time
  import traceback
  import cloudpickle
  import mock
  from horovod.runner.util.threads import in_thread
label_desc: Use image node_id 12 for calling a global function with example usage: lsf_and_jsrun(lsf_exists, jsrun_installed) without return types