def find_reaction_set_index(i, species_reaction_sets):
    """Returns the index of the reaction set in species_reaction_sets where the
    i-th reaction is found.

    :param i: index of a reaction in a reaction set from species_reaction_sets
    :param species_reaction_sets: list of species-specific CoMetGeNe reaction
        sets
    :return: index in species_reaction_sets for the reaction
    """
    nb_reactions = 0
    srs_index = 0

    while nb_reactions < i:
        reaction_set = species_reaction_sets[srs_index]
        nb_reactions += len(reaction_set.reactions)
        srs_index += 1

    return srs_index - 1