def group_records(G, class_label, cutoff=0):
    """ Parse node attributes into group records

    Args:
        G: graph
        class_label: class label

    Returns:
        records: list of dict [{class: name, members: list of index,]
    """
    groups = {}
    for n, node in G.nodes_iter(data=True):
        c = node[class_label]
        if isinstance(c, list):
            for e in c:
                if e not in groups:
                    groups[e] = []
                groups[e].append(n)
        else:
            if c not in groups:
                groups[c] = []
            groups[c].append(n)
    rcds = []
    for c, members in groups.items():
        if len(members) >= cutoff:
            rcds.append({"class": c, "members": members})
    return rcds