code: def _validate_tf_environment(package):
      """Check TF version and (depending on package) warn about TensorFloat32.
  
      Args:
        package: Python `str` indicating which package is being imported. Used for
          package-dependent warning about TensorFloat32.
  
      Raises:
        ImportError: if either tensorflow is not importable or its version is
          inadequate.
      """
      try:
          import tensorflow.compat.v1 as tf
      except (ImportError, ModuleNotFoundError):
          # 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 Probability. This "
              "is so that users can decide whether to install the GPU-enabled "
              "TensorFlow package. To use TensorFlow Probability, please install "
              "the most recent version of TensorFlow, by following instructions at "
              "https://tensorflow.org/install.\n\n"
          )
          raise
  
      import distutils.version
  
      #
      # Update this whenever we need to depend on a newer TensorFlow release.
      #
      required_tensorflow_version = "2.14"
      #   required_tensorflow_version = '1.15'  # Needed internally -- DisableOnExport
  
      if distutils.version.LooseVersion(
          tf.__version__
      ) < distutils.version.LooseVersion(required_tensorflow_version):
          raise ImportError(
              "This version of TensorFlow Probability requires TensorFlow "
              "version >= {required}; Detected an installation of version {present}. "
              "Please upgrade TensorFlow to proceed.".format(
                  required=required_tensorflow_version,
                  present=tf.__version__,
              )
          )
  
      if (
          package == "mcmc"
          and tf.config.experimental.tensor_float_32_execution_enabled()
      ):
          # Must import here, because symbols get pruned to __all__.
          import warnings
  
          warnings.warn(
              "TensorFloat-32 matmul/conv are enabled for NVIDIA Ampere+ GPUs. The "
              "resulting loss of precision may hinder MCMC convergence. To turn off, "
              "run `tf.config.experimental.enable_tensor_float_32_execution(False)`. "
              "For more detail, see https://github.com/tensorflow/community/pull/287."
          )
  
imports: import functools
  import sys
  import types
  from tensorflow_probability.python.internal import all_util
  from tensorflow_probability.python.internal import lazy_loader
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_tf_environment(package) without return types