def gccdicosnap(dicosnap,dicoedgeccm):
    """
    Selects all time-stamped edges with nodes belonging to the maximal connected
    component.

    Parameters:
        dicosnap (dict): Dictionary indexed by timestamps, whose keys are
        edgelists for a given time-slice.
        dicoedgeccm (dict): Dictionary indexed by all edges in the aggregated
        network.

    Returns:
        dicosnapccm (dict): Dictionary indexed by timestamps, whose keys are
        edgelists for a given time-slice, with only edges in the c.c.
    """
    dicosnapccm = {}
    for t in dicosnap.keys():
        dicosnapccm[t] = {}
        dicosnapccm[t]["edgelist"] = []
        for edge in dicosnap[t]["edgelist"]:
            if edge in dicoedgeccm.keys():
                dicosnapccm[t]["edgelist"].append(edge)

    return dicosnapccm