code: def validate_flags_or_throw(bert_config):
      """Validate the input FLAGS or throw an exception."""
      tokenization.validate_case_matches_checkpoint(
          FLAGS.do_lower_case, FLAGS.init_checkpoint
      )
  
      if not FLAGS.do_train and not FLAGS.do_predict:
          raise ValueError(
              "At least one of `do_train` or `do_predict` must be True."
          )
  
      if FLAGS.do_train:
          if not FLAGS.train_file:
              raise ValueError(
                  "If `do_train` is True, then `train_file` must be specified."
              )
      if FLAGS.do_predict:
          if not FLAGS.predict_file:
              raise ValueError(
                  "If `do_predict` is True, then `predict_file` must be specified."
              )
  
      if FLAGS.max_seq_length > bert_config.max_position_embeddings:
          raise ValueError(
              "Cannot use sequence length %d because the BERT model "
              "was only trained up to sequence length %d"
              % (
                  FLAGS.max_seq_length,
                  bert_config.max_position_embeddings,
              )
          )
  
      if FLAGS.max_seq_length <= FLAGS.max_query_length + 3:
          raise ValueError(
              "The max_seq_length (%d) must be greater than max_query_length "
              "(%d) + 3"
              % (FLAGS.max_seq_length, FLAGS.max_query_length)
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import json
  import math
  import os
  import random
  import mesh_tensorflow
  import mesh_tensorflow.bert.bert
  import mesh_tensorflow.bert.optimization
  import mesh_tensorflow.bert.tokenization
  import six
  from six.moves import range
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 12 for calling a global function with example usage: validate_flags_or_throw(bert_config) without return types