code: def compare_version(version1, version2):
      """
      Compare version strings.
      :param version1;
      :param version2;
      :return: 1 if version1 is after version2; -1 if version1 is before version2; 0 if two versions
       are the same.
      """
      v1Arr = version1.split(".")
      v2Arr = version2.split(".")
      len1 = len(v1Arr)
      len2 = len(v2Arr)
      lenMax = max(len1, len2)
      for x in range(lenMax):
          v1Token = 0
          if x < len1:
              v1Token = int(v1Arr[x])
          v2Token = 0
          if x < len2:
              v2Token = int(v2Arr[x])
          if v1Token < v2Token:
              return -1
          if v1Token > v2Token:
              return 1
      return 0
  
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 10 for calling a global function with example usage: compare_version(version1, version2) and returns: int, unknown, int