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: Returns a legacy TensorFlow image URI based on the estimator arguments if possible.
docstr_tok: ["Returns","a","legacy","TensorFlow","image","URI","based","on","the","estimator","arguments","if","possible","."]
code: def _image_uri_from_args(self, keywords):
      """Returns a legacy TensorFlow image URI based on the estimator arguments if possible."""
      tf_version = framework_version.FRAMEWORK_DEFAULTS["TensorFlow"]
      instance_type = (
          "ml.m4.xlarge"  # CPU default (exact type doesn't matter)
      )
  
      for kw in keywords:
          if kw.arg == "framework_version":
              tf_version = (
                  kw.value.s if isinstance(kw.value, ast.Str) else None
              )
          if kw.arg == "train_instance_type":
              instance_type = (
                  kw.value.s if isinstance(kw.value, ast.Str) else None
              )
  
      if tf_version and instance_type:
          return image_uris.retrieve(
              "tensorflow",
              self.region,
              version=tf_version,
              py_version="py2",
              instance_type=instance_type,
              image_scope="training",
          ).replace("-scriptmode", "")
  
      return None
  
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 10 for calling the TensorFlowLegacyModeConstructorUpgrader obj's underlying member method code with example usage: obj._image_uri_from_args(keywords) and returns: None, image_uris