def _guess_orders(groups, rotor_class):
    """Guess possible group orders based on groups.

    The guess consists of the numbers two to n, where n is the number of
    elements in the largest group. For cubic groups, n is taken to be at most
    five. The trivial order one is never guessed.

    Parameters
    ----------
    groups : sequence of sequence of int
        Groups of symmetry equivalent atoms, in ascending order of size.
    rotor_class : tuple of str
        Rigid rotor classification.

    Returns
    -------
    sequence of int

    Examples
    --------
    >>> _guess_orders([[0], [1, 2, 3, 4], [5, 6, 7, 8]],
    ...               ("symmetric prolate", "nonplanar"))
    range(2, 5)
    >>> _guess_orders([[0], [1, 2, 3, 4], [5, 6, 7, 8]],
    ...               ("spheric", "nonplanar"))
    range(2, 5)
    >>> _guess_orders([[0], [1, 2, 3, 4], [5, 6, 7, 8, 9, 10]],
    ...               ("symmetric prolate", "nonplanar"))
    range(2, 7)
    >>> _guess_orders([[0], [1, 2, 3, 4], [5, 6, 7, 8, 9, 10]],
    ...               ("spheric", "nonplanar"))
    range(2, 6)
    """
    max_order = len(groups[-1])
    if rotor_class[0] == "spheric":
        max_order = min(max_order, 5)
    return range(2, max_order + 1)