code: def is_spark_below_2_2():
      """
      Check if spark version is below 2.2
      """
      import pyspark
  
      if hasattr(pyspark, "version"):
          full_version = pyspark.version.__version__
          # We only need the general spark version (eg, 1.6, 2.2).
          parts = full_version.split(".")
          spark_version = parts[0] + "." + parts[1]
          if compare_version(spark_version, "2.2") >= 0:
              return False
      return True
  
file_path: BigDL/python/dllib/src/bigdl/dllib/utils/engine.py
imports: import sys
  import os
  import glob
  import warnings
  import logging
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 9 for calling a global function with example usage: is_spark_below_2_2() and returns: True, False