def parse_pattern(pattern):
    """
    Crack a pattern definition into its type and any grouping.

    A pattern consists of the pattern type (e.g. flashing, occulting)
    and optionally a group designation in parentheses.

    The pattern definition could just be the type

    >>> parse_pattern('Fl')
    ('fl', [1])

    It could have optional dots marking the abbreviation,
    these can be discarded

    >>> parse_pattern('L.Fl.')
    ('lfl', [1])

    It could have grouping information in parentheses

    >>> parse_pattern('Fl(2)')
    ('fl', [2])

    The group could be a composite group.

    >>> parse_pattern('Oc(2+1)')
    ('oc', [2, 1])
    """
    pattern_type, _, group_spec = pattern.partition('(')
    # Groups are separated by '+' in a composite pattern.
    groups = [
        int(group) for group in group_spec[:-1].split('+')
    ] if group_spec else [1]

    # Some light lists use dots, some don't, just throw them away
    return pattern_type.lower().replace('.', ''), groups