def _ExcludeScore(config_name, input_name, test_data_gen_name, score_name,
                  args):
  """Decides whether excluding a score.

  Given a score descriptor, encoded in config_name, input_name,
  test_data_gen_name and score_name, use the corresponding regular expressions
  to determine if the score should be excluded.

  Args:
    config_name: APM configuration name.
    input_name: input audio track name.
    test_data_gen_name: test data generator name.
    score_name: evaluation score name.
    args: parsed arguments.

  Returns:
    A boolean.
  """
  value_regexpr_pairs = [
      (config_name, args.config_names),
      (input_name, args.input_names),
      (test_data_gen_name, args.test_data_generators),
      (score_name, args.eval_scores),
  ]

  # Score accepted if each value matches the corresponding regular expression.
  for value, regexpr in value_regexpr_pairs:
    if regexpr is None:
      continue
    if not regexpr.match(value):
      return True

  return False