code: def _ensure_tf_install():  # pylint: disable=g-statement-before-imports
      """Attempt to import tensorflow, and ensure its version is sufficient.
  
      Raises:
        ImportError: if either tensorflow is not importable or its version is
        inadequate.
      """
      try:
          import tensorflow.compat.v2 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 TF Quant Finance library. "
              "This is so that users can decide whether to install the GPU-enabled "
              "TensorFlow package. To use TF Quant Finance library, please install "
              "the most recent version of TensorFlow, by following instructions at "
              "https://tensorflow.org/install.\n\n"
          )
          raise
  
      import distutils.version
  
      if distutils.version.LooseVersion(
          tf.__version__
      ) < distutils.version.LooseVersion(_REQUIRED_TENSORFLOW_VERSION):
          raise ImportError(
              "This version of TF Quant Finance library requires TensorFlow "
              "version >= {required}; Detected an installation of version {present}. "
              "Please upgrade TensorFlow to proceed.".format(
                  required=_REQUIRED_TENSORFLOW_VERSION,
                  present=tf.__version__,
              )
          )
  
file_path: tf-quant-finance/tf_quant_finance/__init__.py
imports: import sys
  from tf_quant_finance import black_scholes
  from tf_quant_finance import datetime
  from tf_quant_finance import math
  from tf_quant_finance import models
  from tf_quant_finance import rates
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tensorflow.python.util.all_util import remove_undocumented
label_desc: Use image node_id 2 for calling a global function with example usage: _ensure_tf_install() without return types