code: def _accumulate_basic(betweenness, S, P, sigma, s):
      delta = dict.fromkeys(S, 0)
      while S:
          w = S.pop()
          coeff = (1 + delta[w]) / sigma[w]
          for v in P[w]:
              delta[v] += sigma[v] * coeff
          if w != s:
              betweenness[w] += delta[w]
      return betweenness, delta
  
file_path: networkx/networkx/algorithms/centrality/betweenness.py
imports: from collections import deque
  from heapq import heappop, heappush
  from itertools import count
  import networkx
  from networkx.algorithms.shortest_paths.weighted import _weight_function
  from networkx.utils import py_random_state
  from networkx.utils.decorators import not_implemented_for
label_desc: Use image node_id 5 for calling a global function with example usage: _accumulate_basic(betweenness, S, P, sigma, s) and returns: betweenness,  delta