def FindFailuresInSameTest(result_map, target_suite, target_test,
                           target_typ_tags):
  """Finds all other failures that occurred in the given test.

  Ignores the failures for the test on the same configuration.

  Args:
    result_map: Aggregated query results from results.AggregateResults.
    target_suite: A string containing the test suite being checked.
    target_test: A string containing the target test case being checked.
    target_typ_tags: A list of strings containing the typ tags that the failure
        took place on.

  Returns:
    A list of tuples (typ_tags, count). |typ_tags| is a list of strings
    defining a configuration the specified test failed on. |count| is how many
    times the test failed on that configuration.
  """
  other_failures = []
  target_typ_tags = tuple(target_typ_tags)
  tag_map = result_map.get(target_suite, {}).get(target_test, {})
  for typ_tags, build_url_list in tag_map.items():
    if typ_tags == target_typ_tags:
      continue
    other_failures.append((typ_tags, len(build_url_list)))
  return other_failures