code: def is_built(gloo_is_built, mpi_is_built):
      """
      Patches the gloo_built and mpi_built methods called from horovod.runner.run.run_controller
      to return the given booleans. That method is used by horovod.spark.run to determine which
      controller to use. Patching these methods allows to test horovod.spark.run without an MPI
      implementation to be installed.
  
      :param gloo_is_built: boolean returned by gloo_built
      :param mpi_is_built: boolean returned by mpi_built
      :return: mocked gloo_built and mpi_built methods
      """
      with mock.patch(
          "horovod.runner.launch.gloo_built", return_value=gloo_is_built
      ) as g:
          with mock.patch(
              "horovod.runner.launch.mpi_built",
              return_value=mpi_is_built,
          ) as m:
              yield g, m
  
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 10 for calling a global function with example usage: is_built(gloo_is_built, mpi_is_built) without return types