code: def _community_edge_betweenness(
      graph, clusters=None, directed=True, weights=None
  ):
      """Community structure based on the betweenness of the edges in the
      network.
  
      The idea is that the betweenness of the edges connecting two
      communities is typically high, as many of the shortest paths between
      nodes in separate communities go through them. So we gradually remove
      the edge with the highest betweenness and recalculate the betweennesses
      after every removal. This way sooner or later the network falls of to
      separate components. The result of the clustering will be represented
      by a dendrogram.
  
      @param clusters: the number of clusters we would like to see. This
        practically defines the "level" where we "cut" the dendrogram to
        get the membership vector of the vertices. If C{None}, the dendrogram
        is cut at the level that maximizes the modularity when the graph is
        unweighted; otherwise the dendrogram is cut at at a single cluster
        (because cluster count selection based on modularities does not make
        sense for this method if not all the weights are equal).
      @param directed: whether the directionality of the edges should be
        taken into account or not.
      @param weights: name of an edge attribute or a list containing
        edge weights.
      @return: a L{VertexDendrogram} object, initally cut at the maximum
        modularity or at the desired number of clusters.
      """
      merges, qs = GraphBase.community_edge_betweenness(
          graph, directed, weights
      )
      if clusters is None:
          if qs is not None:
              clusters = (
                  _optimal_cluster_count_from_merges_and_modularity(
                      graph, merges, qs
                  )
              )
          else:
              clusters = 1
  
      return VertexDendrogram(
          graph,
          merges,
          clusters,
          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 7 for calling a global function with example usage: _community_edge_betweenness(graph, clusters, directed, weights) and returns: VertexDendrogram