def _prefix_index_of(item, prefixes):
    """Returns the index of the first value in `prefixes` that is a prefix of `item`.

    If none of the prefixes match, return the size of `prefixes`.

    Args:
      item: the item to match
      prefixes: prefixes to match against

    Returns:
      an integer representing the index of the match described above.
    """
    for index, prefix in enumerate(prefixes):
        if item.startswith(prefix):
            return index
    return len(prefixes)