def validate_flags_or_throw():
  """Validate the input FLAGS or throw an exception."""
  if (not FLAGS.do_train and not FLAGS.do_predict and not FLAGS.do_test):
    raise ValueError("At least one of `do_train`, `do_predict` or "
                     "`do_test` 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.")
Validate the input FLAGS or throw an exception.
language/labs/drkit/run_multihop_follow.py