def group_versions(versions):
 return list((list(releases) for (_, releases) in itertools.groupby(versions, operator.attrgetter(u'major_minor'))))

def group_versions ( versions ) : return list ( ( list ( releases ) for ( _ , releases ) in itertools . groupby ( versions , operator . attrgetter ( u'major_minor' ) ) ) )
group versions by major .