code: def _community_infomap(
      graph, edge_weights=None, vertex_weights=None, trials=10
  ):
      """Finds the community structure of the network according to the Infomap
      method of Martin Rosvall and Carl T. Bergstrom.
  
      B{References}
  
        - M. Rosvall and C. T. Bergstrom: Maps of information flow reveal
          community structure in complex networks, I{PNAS} 105, 1118 (2008).
          U{http://dx.doi.org/10.1073/pnas.0706851105},
          U{http://arxiv.org/abs/0707.0609}.
        - M. Rosvall, D. Axelsson, and C. T. Bergstrom: The map equation,
          I{Eur Phys. J Special Topics} 178, 13 (2009).
          U{http://dx.doi.org/10.1140/epjst/e2010-01179-1},
          U{http://arxiv.org/abs/0906.1405}.
  
      @param edge_weights: name of an edge attribute or a list containing
        edge weights.
      @param vertex_weights: name of an vertex attribute or a list containing
        vertex weights.
      @param trials: the number of attempts to partition the network.
      @return: an appropriate L{VertexClustering} object with an extra attribute
        called C{codelength} that stores the code length determined by the
        algorithm.
      """
      membership, codelength = GraphBase.community_infomap(
          graph, edge_weights, vertex_weights, trials
      )
      return VertexClustering(
          graph,
          membership,
          params={"codelength": codelength},
          modularity_params={"weights": edge_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 2 for calling a global function with example usage: _community_infomap(graph, edge_weights, vertex_weights, trials) and returns: VertexClustering