code: def require_cloud_storage(flag_names):
      """Register a validator to check directory flags.
      Args:
        flag_names: An iterable of strings containing the names of flags to be
          checked.
      """
      msg = "TPU requires GCS path for {}".format(", ".join(flag_names))
  
      @flags.multi_flags_validator(["tpu"] + flag_names, message=msg)
      def _path_check(flag_values):  # pylint: disable=missing-docstring
          if flag_values["tpu"] is None:
              return True
  
          valid_flags = True
          for key in flag_names:
              if not flag_values[key].startswith("gs://"):
                  tf.compat.v1.logging.error(
                      "{} must be a GCS path.".format(key)
                  )
                  valid_flags = False
  
          return valid_flags
  
file_path: autodist/examples/benchmark/utils/flags/_device.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import flags
  import tensorflow
  from utils.flags._conventions import help_wrap
label_desc: Use image node_id 1 for calling a global function with example usage: require_cloud_storage(flag_names) and returns: valid_flags, True