code: def _community_label_propagation(
      graph, weights=None, initial=None, fixed=None
  ):
      """Finds the community structure of the graph according to the label
      propagation method of Raghavan et al.
  
      Initially, each vertex is assigned a different label. After that,
      each vertex chooses the dominant label in its neighbourhood in each
      iteration. Ties are broken randomly and the order in which the
      vertices are updated is randomized before every iteration. The
      algorithm ends when vertices reach a consensus.
  
      Note that since ties are broken randomly, there is no guarantee that
      the algorithm returns the same community structure after each run.
      In fact, they frequently differ. See the paper of Raghavan et al
      on how to come up with an aggregated community structure.
  
      Also note that the community _labels_ (numbers) have no semantic meaning
      and igraph is free to re-number communities. If you use fixed labels,
      igraph may still re-number the communities, but co-community membership
      constraints will be respected: if you had two vertices with fixed labels
      that belonged to the same community, they will still be in the same
      community at the end. Similarly, if you had two vertices with fixed
      labels that belonged to different communities, they will still be in
      different communities at the end.
  
      B{Reference}: Raghavan, U.N. and Albert, R. and Kumara, S. Near linear
      time algorithm to detect community structures in large-scale networks.
      I{Phys Rev} E 76:036106, 2007. U{http://arxiv.org/abs/0709.2938}.
  
      @param weights: name of an edge attribute or a list containing
        edge weights
      @param initial: name of a vertex attribute or a list containing
        the initial vertex labels. Labels are identified by integers from
        zero to M{n-1} where M{n} is the number of vertices. Negative
        numbers may also be present in this vector, they represent unlabeled
        vertices.
      @param fixed: a list of booleans for each vertex. C{True} corresponds
        to vertices whose labeling should not change during the algorithm.
        It only makes sense if initial labels are also given. Unlabeled
        vertices cannot be fixed. It may also be the name of a vertex
        attribute; each attribute value will be interpreted as a Boolean.
      @return: an appropriate L{VertexClustering} object.
      """
      if isinstance(fixed, str):
          fixed = [bool(o) for o in graph.vs[fixed]]
      cl = GraphBase.community_label_propagation(
          graph, weights, initial, fixed
      )
      return VertexClustering(
          graph, cl, modularity_params={"weights": weights}
      )
  
file_path: python-igraph/src/igraph/community.py
imports: from igraph._igraph import GraphBase
  from igraph.clustering import VertexDendrogram, VertexClustering
  from igraph.utils import deprecated
  from typing import List, Sequence, Tuple
label_desc: Use image node_id 4 for calling a global function with example usage: _community_label_propagation(graph, weights, initial, fixed) and returns: VertexClustering