code: def _macos_version():
      """
      Returns macOS version as a tuple of integers, making it easy to do proper
      version comparisons. On non-Macs, it returns an empty tuple.
      """
      if sys.platform == "darwin":
          try:
              import subprocess
  
              ver_str = (
                  subprocess.run(
                      ["sw_vers", "-productVersion"],
                      stdout=subprocess.PIPE,
                  )
                  .stdout.decode("utf-8")
                  .strip("\n")
              )
              return tuple([int(v) for v in ver_str.split(".")])
          except:
              raise Exception("Unable to determine the macOS version")
      return ()
  
file_path: coremltools/coremltools/test/optimize/torch/utils.py
imports: import pathlib
  import sys
  from packaging import version
label_desc: Use image node_id 2 for calling a global function with example usage: _macos_version() and returns: , tuple