code: def _py_version_defaults(
      framework, framework_version, is_model=False
  ):
      """Gets the py_version required for the framework_version and if it's a model
  
      Args:
          framework (str): name of the framework
          framework_version (str): version of the framework
          is_model (bool): whether it is a constructor for a model or not
  
      Returns:
          str: the default py version, as appropriate. None if no default py_version
      """
      if framework in ("Chainer", "PyTorch"):
          return "py3"
      if framework == "SKLearn" and not is_model:
          return "py3"
      if framework == "MXNet":
          return "py2"
      if framework == "TensorFlow" and not is_model:
          return _tf_py_version_default(framework_version)
      return None
  
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 1 for calling a global function with example usage: _py_version_defaults(framework, framework_version, is_model) and returns: None, str, str, str, _tf_py_version_default