code: def check_installed_version(name, version, exception=None):
      file_path = os.path.abspath(
          os.path.join(
              os.path.dirname(os.path.abspath(__file__)),
              os.pardir,
              "metadata.json",
          )
      )
      with open(file_path) as f:
          installed_version = json.load(f).get(name)
          if installed_version != version:
              if exception is None:
                  warnings.warn(
                      get_version_mismatch_message(
                          name, version, installed_version
                      )
                  )
              else:
                  raise HorovodVersionMismatchError(
                      name, version, installed_version
                  ) from exception
  
imports: import json
  import multiprocessing
  import os
  import sys
  import sysconfig
  import warnings
  from contextlib import contextmanager
  from horovod.common.exceptions import get_version_mismatch_message, HorovodVersionMismatchError
label_desc: Use image node_id 17 for calling a global function with example usage: check_installed_version(name, version, exception) without return types