def extract_test_prefix(raw_fullname):
  """Returns a (prefix, fullname) tuple corresponding to raw_fullname."""

  fullname = raw_fullname.replace('FLAKY_', '').replace('FAILS_', '')

  test_prefix = ''
  if 'FLAKY_' in raw_fullname:
    test_prefix = 'FLAKY'
  elif 'FAILS_' in raw_fullname:  # pragma: no cover
    test_prefix = 'FAILS'

  return (test_prefix, fullname)