code: def mpi_implementation_flags(
      flags=["--mock-mpi-impl-flags"],
      binding_args=["--mock-mpi-binding-args"],
      mpi=None,
  ):
      """
      Patches the _get_mpi_implementation_flags method used by horovod.runner.mpi_run to retrieve
      MPI implementation specific command line flags. Patching this method allows to test mpi_run
      without an MPI implementation to be installed.
  
      :param flags: mock flags
      :return: the mocked method
      """
      with mock.patch(
          "horovod.runner.mpi_run._get_mpi_implementation_flags",
          return_value=(flags, binding_args, mpi),
      ) as m:
          yield 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 11 for calling a global function with example usage: mpi_implementation_flags(flags, binding_args, mpi) without return types