code: def _community_leading_eigenvector(
      graph, clusters=None, weights=None, arpack_options=None
  ):
      """Newman's leading eigenvector method for detecting community structure.
  
      This is the proper implementation of the recursive, divisive algorithm:
      each split is done by maximizing the modularity regarding the
      original network.
  
      B{Reference}: MEJ Newman: Finding community structure in networks using the
      eigenvectors of matrices, arXiv:physics/0605087
  
      @param clusters: the desired number of communities. If C{None}, the
        algorithm tries to do as many splits as possible. Note that the
        algorithm won't split a community further if the signs of the leading
        eigenvector are all the same, so the actual number of discovered
        communities can be less than the desired one.
      @param weights: name of an edge attribute or a list containing
        edge weights.
      @param arpack_options: an L{ARPACKOptions} object used to fine-tune
        the ARPACK eigenvector calculation. If omitted, the module-level
        variable called C{arpack_options} is used.
      @return: an appropriate L{VertexClustering} object.
      """
      if clusters is None:
          clusters = -1
  
      kwds = {"weights": weights}
      if arpack_options is not None:
          kwds["arpack_options"] = arpack_options
  
      membership, _, q = GraphBase.community_leading_eigenvector(
          graph, clusters, **kwds
      )
      return VertexClustering(graph, membership, modularity=q)
  
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 3 for calling a global function with example usage: _community_leading_eigenvector(graph, clusters, weights, arpack_options) and returns: VertexClustering