class_docstr: A class to turn legacy mode parameters into hyperparameters.
  
  It also disables the ``model_dir`` hyperparameter, and set the
  image URI when instantiating a TensorFlow estimator.
docstr: Checks if the ``ast.Call`` node's keywords signal using legacy mode.
docstr_tok: ["Checks","if","the","``","ast.Call","``","node","'s","keywords","signal","using","legacy","mode","."]
code: def _is_legacy_mode(self, node):
      """Checks if the ``ast.Call`` node's keywords signal using legacy mode."""
      script_mode = False
      py_version = "py2"
  
      for kw in node.keywords:
          if kw.arg == "script_mode":
              script_mode = (
                  bool(kw.value.value)
                  if isinstance(kw.value, ast.NameConstant)
                  else True
              )
          if kw.arg == "py_version":
              py_version = (
                  kw.value.s if isinstance(kw.value, ast.Str) else "py3"
              )
  
      return not (py_version.startswith("py3") or script_mode)
  
imports: from __future__ import absolute_import
  import ast
  import boto3
  import six
  from sagemaker.cli.compatibility.v2.modifiers import framework_version, matching
  from sagemaker.cli.compatibility.v2.modifiers.modifier import Modifier
  from sagemaker import image_uris
label_desc: Use image node_id 4 for calling the TensorFlowLegacyModeConstructorUpgrader obj's underlying member method code with example usage: obj._is_legacy_mode(node) and returns: unknown