code: def check_lib_version(
      lib_name: str, checked_version: str, operator
  ) -> Tuple[Optional[bool], str]:
      """
      Checks if a library is installed, and if it is, checks the operator(lib.__version__, checked_version) as a result.
      This bool result along with a string analysis of result is returned.
  
      If the library is not installed at all, then returns None instead, along with a string explaining
      that the library is not installed
  
      Args:
          lib_name: lower case str name of the library that must be imported.
          checked_version: semver string that is compared against lib.__version__.
          operator: binary callable function func(a, b) -> bool; that compares lib.__version__ against version in
              some manner. Must return a boolean.
  
      Returns:
          A tuple of results:
          -   Bool or None. Bool if the library could be imported, and the result of
              operator(lib.__version__, checked_version) or False if __version__ is not implemented in lib.
              None is passed if the library is not installed at all.
          -   A string analysis of the check.
      """
      try:
          if "." in lib_name:
              mod = import_class_by_path(lib_name)
          else:
              mod = importlib.import_module(lib_name)
  
          if hasattr(mod, "__version__"):
              lib_ver = version.Version(mod.__version__)
              match_ver = version.Version(checked_version)
  
              if operator(lib_ver, match_ver):
                  msg = f"Lib {lib_name} version is satisfied !"
                  return True, msg
              else:
                  msg = (
                      f"Lib {lib_name} version ({lib_ver}) is not {operator.__name__} than required version {checked_version}.\n"
                      f"Please upgrade the lib using either pip or conda to the latest version."
                  )
                  return False, msg
          else:
              msg = (
                  f"Lib {lib_name} does not implement __version__ in its init file. "
                  f"Could not check version compatibility."
              )
              return False, msg
      except (AttributeError, ImportError, ModuleNotFoundError):
          pass
  
      msg = f"Lib {lib_name} has not been installed. Please use pip or conda to install this package."
      return None, msg
  
imports: import copy
  import importlib
  import os
  from dataclasses import dataclass, is_dataclass
  from enum import Enum
  from functools import lru_cache
  from pathlib import Path
  from typing import List, Optional, Tuple, Union
  import wrapt
  from nemo.utils import AppState, logging
  from nemo.utils.data_utils import resolve_cache_dir
  from nemo.utils.data_utils import is_datastore_path
label_desc: Use image node_id 12 for calling a global function with example usage: check_lib_version(lib_name, checked_version, operator) and returns: None,  msg, False,  msg, True,  msg, False,  msg