code: def _community_walktrap(graph, weights=None, steps=4):
      """Community detection algorithm of Latapy & Pons, based on random
      walks.
  
      The basic idea of the algorithm is that short random walks tend to stay
      in the same community. The result of the clustering will be represented
      as a dendrogram.
  
      B{Reference}: Pascal Pons, Matthieu Latapy: Computing communities in large
      networks using random walks, U{http://arxiv.org/abs/physics/0512106}.
  
      @param weights: name of an edge attribute or a list containing
        edge weights
      @param steps: length of random walks to perform
  
      @return: a L{VertexDendrogram} object, initially cut at the maximum
        modularity.
      """
      merges, qs = GraphBase.community_walktrap(graph, weights, steps)
      optimal_count = _optimal_cluster_count_from_merges_and_modularity(
          graph, merges, qs
      )
      return VertexDendrogram(
          graph,
          merges,
          optimal_count,
          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 9 for calling a global function with example usage: _community_walktrap(graph, weights, steps) and returns: VertexDendrogram