class_docstr: Ensures that ``framework_version`` is defined when instantiating a framework estimator.
class_docstr_tok: ["Ensures","that","``","framework_version","``","is","defined","when","instantiating","a","framework","estimator","."]
docstr: Modifies the ``ast.Call`` node's keywords to include ``framework_version``.
  
  The ``framework_version`` value is determined by the framework:
  
  - Chainer: "4.1.0"
  - MXNet: "1.2.0"
  - PyTorch: "0.4.0"
  - SKLearn: "0.20.0"
  - TensorFlow: "1.11.0"
  
  The ``py_version`` value is determined by the framework, framework_version, and if it is a
  model, whether the model accepts a py_version
  
  Args:
      node (ast.Call): a node that represents the constructor of a framework class.
  
  Returns:
      ast.AST: the original node, which has been potentially modified.
docstr_tok: ["Modifies","the","``","ast.Call","``","node","'s","keywords","to","include","``","framework_version","``",".","The","``","framework_version","``","value","is","determined","by","the","framework",":","-","Chainer",":","``","4.1.0","''","-","MXNet",":","``","1.2.0","''","-","PyTorch",":","``","0.4.0","''","-","SKLearn",":","``","0.20.0","''","-","TensorFlow",":","``","1.11.0","''","The","``","py_version","``","value","is","determined","by","the","framework",",","framework_version",",","and","if","it","is","a","model",",","whether","the","model","accepts","a","py_version","Args",":","node","(","ast.Call",")",":","a","node","that","represents","the","constructor","of","a","framework","class",".","Returns",":","ast.AST",":","the","original","node",",","which","has","been","potentially","modified","."]
code: def modify_node(self, node):
      """Modifies the ``ast.Call`` node's keywords to include ``framework_version``.
  
      The ``framework_version`` value is determined by the framework:
  
      - Chainer: "4.1.0"
      - MXNet: "1.2.0"
      - PyTorch: "0.4.0"
      - SKLearn: "0.20.0"
      - TensorFlow: "1.11.0"
  
      The ``py_version`` value is determined by the framework, framework_version, and if it is a
      model, whether the model accepts a py_version
  
      Args:
          node (ast.Call): a node that represents the constructor of a framework class.
  
      Returns:
          ast.AST: the original node, which has been potentially modified.
      """
      framework, is_model = _framework_from_node(node)
  
      # if framework_version is not supplied, get default and append keyword
      if matching.has_arg(node, FRAMEWORK_ARG):
          framework_version = parsing.arg_value(node, FRAMEWORK_ARG)
      else:
          framework_version = FRAMEWORK_DEFAULTS[framework]
          node.keywords.append(
              ast.keyword(
                  arg=FRAMEWORK_ARG, value=ast.Str(s=framework_version)
              )
          )
  
      # if py_version is not supplied, get a conditional default, and if not None, append keyword
      if not matching.has_arg(node, PY_ARG):
          py_version = _py_version_defaults(
              framework, framework_version, is_model
          )
          if py_version:
              node.keywords.append(
                  ast.keyword(arg=PY_ARG, value=ast.Str(s=py_version))
              )
      return node
  
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 the FrameworkVersionEnforcer obj's underlying member method code with example usage: obj.modify_node(node) and returns: node