code: def ensure_tf_install():  # pylint: disable=g-statement-before-imports
    
    try:
      import tensorflow as tf
    except ImportError:
      # Print more informative error message, then reraise.
      print("\n\nFailed to import TensorFlow. Please note that TensorFlow is not "
            "installed by default when you install TensorFlow Datasets. This is "
            "so that users can decide whether to install the GPU-enabled "
            "TensorFlow package. To use TensorFlow Datasets, please install the "
            "most recent version of TensorFlow, by following instructions at "
            "https://tensorflow.org/install.\n\n")
      raise
  
    tf_version = distutils.version.LooseVersion(tf.__version__)
    v_1_12 = distutils.version.LooseVersion("1.12.0")
    if tf_version < v_1_12:
      raise ImportError(
          "This version of TensorFlow Datasets requires TensorFlow "
          "version >= {required}; Detected an installation of version {present}. "
          "Please upgrade TensorFlow to proceed.".format(
              required="1.12.0",
              present=tf.__version__))
    _patch_tf(tf)
docs: Attempt to import tensorflow, and ensure its version is sufficient.
  
    Raises:
      ImportError: if either tensorflow is not importable or its version is
      inadequate.