def find_partition_temporal(graphs, partition_type,<EOL>interslice_weight=<NUM_LIT:1>,<EOL>slice_attr='<STR_LIT>', vertex_id_attr='<STR_LIT:id>',<EOL>edge_type_attr='<STR_LIT:type>', weight_attr='<STR_LIT>',<EOL>**kwargs):
<EOL>G_layers, G_interslice, G = time_slices_to_layers(graphs,<EOL>interslice_weight,<EOL>slice_attr=slice_attr,<EOL>vertex_id_attr=vertex_id_attr,<EOL>edge_type_attr=edge_type_attr,<EOL>weight_attr=weight_attr)<EOL>arg_dict = {}<EOL>if '<STR_LIT>' in partition_type.__init__.__code__.co_varnames:<EOL><INDENT>arg_dict['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT>if '<STR_LIT>' in partition_type.__init__.__code__.co_varnames:<EOL><INDENT>arg_dict['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT>arg_dict.update(kwargs)<EOL>partitions = []<EOL>for H in G_layers:<EOL><INDENT>arg_dict['<STR_LIT>'] = H<EOL>partitions.append(partition_type(**arg_dict))<EOL><DEDENT>partition_interslice = CPMVertexPartition(G_interslice, resolution_parameter=<NUM_LIT:0>,<EOL>node_sizes='<STR_LIT>', weights=weight_attr)<EOL>optimiser = Optimiser()<EOL>improvement = optimiser.optimise_partition_multiplex(partitions + [partition_interslice])<EOL>membership = {(v[slice_attr], v[vertex_id_attr]): m for v, m in zip(G.vs, partitions[<NUM_LIT:0>].membership)}<EOL>membership_time_slices = []<EOL>for slice_idx, H in enumerate(graphs):<EOL><INDENT>membership_slice = [membership[(slice_idx, v[vertex_id_attr])] for v in H.vs]<EOL>membership_time_slices.append(list(membership_slice))<EOL><DEDENT>return membership_time_slices, improvement<EOL>
Detect communities for temporal graphs.

    Each graph is considered to represent a time slice and does not necessarily
    need to be defined on the same set of vertices. Nodes in two consecutive
    slices are identified on the basis of the ``vertex_id_attr``, i.e. if two
    nodes in two consecutive slices have an identical value of the
    ``vertex_id_attr`` they are coupled.  The ``vertex_id_attr`` should hence be
    unique in each slice. The nodes are then coupled with a weight of
    ``interslice_weight`` which is set in the edge attribute ``weight_attr``. No
    weight is set if the ``interslice_weight`` is None (i.e.  corresponding in
    practice with a weight of 1). See :func:`time_slices_to_layers` for
    a more detailed explanation.

    Parameters
    ----------
    graphs : list of :class:`ig.Graph`
      List of :class:`louvain.VertexPartition` layers to optimise.

    partition_type : type of :class:`VertexPartition.MutableVertexPartition`
      The type of partition to use for optimisation (identical for all graphs).

    interslice_weight : float
      The weight of the coupling between two consecutive time slices.

    slice_attr : string
      The vertex attribute to use for indicating the slice of a node.

    vertex_id_attr : string
      The vertex to use to identify nodes.

    edge_type_attr : string
      The edge attribute to use for indicating the type of link (`interslice` or
      `intraslice`).

    weight_attr : string
      The edge attribute used to indicate the weight.

    **kwargs
      Remaining keyword arguments, passed on to constructor of
      ``partition_type``.

    Returns
    -------
    list of membership
      list containing for each slice the membership vector.

    float
      Improvement in quality of combined partitions, see
      :func:`Optimiser.optimise_partition_multiplex`.

    See Also
    --------
    :func:`time_slices_to_layers`

    :func:`slices_to_layers`

    Examples
    --------
    >>> n = 100
    >>> G_1 = ig.Graph.Lattice([n], 1)
    >>> G_1.vs['id'] = range(n)
    >>> G_2 = ig.Graph.Lattice([n], 1)
    >>> G_2.vs['id'] = range(n)
    >>> membership, improvement = louvain.find_partition_temporal([G_1, G_2], 
    ...                                                           louvain.ModularityVertexPartition, 
    ...                                                           interslice_weight=1)