code: def err_if_tf2(msg="err"):
      if is_tf2:
          if msg == "err":
              msg = "contrib is unavailable in tf2."
              raise ImportError(msg)
          else:
              msg = "contrib is unavailable in tf2."
              logging.info(msg)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import logging
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling a global function with example usage: err_if_tf2(msg) without return types