code: def exec_command(command):
      exit_code = 1
      output_msg = ""
  
      # Try ssh 3 times
      for _ in range(SSH_RETRIES):
          output = io.StringIO()
          try:
              exit_code = safe_shell_exec.execute(
                  command, stdout=output, stderr=output
              )
              if exit_code == 0:
                  break
              else:
                  output_msg = output.getvalue()
          finally:
              output.close()
      return exit_code, output_msg
  
file_path: bluefog/bluefog/run/network_util.py
imports: import concurrent.futures
  import io
  import os
  import re
  import socket
  import psutil
  from bluefog.run.horovodrun.common.util import safe_shell_exec
label_desc: Use image node_id 7 for calling a global function with example usage: exec_command(command) and returns: exit_code,  output_msg