code: def rank_nodes_by_pagerank(
      graph: nx.Graph,
      weight: str = "weight",
      **kwargs,
  ) -> dict[Any, float]:
      """
      Rank nodes in ``graph`` using the Pagegrank algorithm.
  
      Args:
          graph
          weight: Key in edge data that holds weights.
          **kwargs
  
      Returns:
          Mapping of node object to Pagerank score.
      """
      return nx_pagerank(graph, weight=weight, **kwargs)
  
file_path: textacy/src/textacy/representations/network.py
imports: from __future__ import annotations
  import collections
  import itertools
  import logging
  from operator import itemgetter
  from typing import Any, Collection, Literal, Optional, Sequence, Union
  import networkx
  import numpy
  from cytoolz import itertoolz
  from ..None import errors, similarity
label_desc: Use image node_id 3 for calling a global function with example usage: rank_nodes_by_pagerank(graph, weight) and returns: nx_pagerank