code: def _tf_py_version_default(framework_version):
      """Gets the py_version default based on framework_version for TensorFlow."""
      if not framework_version:
          return "py2"
  
      try:
          version = Version(framework_version)
      except InvalidVersion:
          return "py2"
  
      if version < Version("1.12"):
          return "py2"
      if version < Version("2.2"):
          return "py3"
      return "py37"
  
file_path: sagemaker-python-sdk/src/sagemaker/cli/compatibility/v2/modifiers/framework_version.py
imports: from __future__ import absolute_import
  import ast
  from packaging.version import InvalidVersion, Version
  from sagemaker.cli.compatibility.v2.modifiers import matching, parsing
  from sagemaker.cli.compatibility.v2.modifiers.modifier import Modifier
label_desc: Use image node_id 2 for calling a global function with example usage: _tf_py_version_default(framework_version) and returns: str, str, str, str, str