code: def _rescale_e(betweenness, n, normalized, directed=False):
      """edge_betweenness_centrality_subset helper."""
      if normalized:
          if n <= 1:
              scale = None  # no normalization b=0 for all nodes
          else:
              scale = 1.0 / (n * (n - 1))
      else:  # rescale by 2 for undirected graphs
          if not directed:
              scale = 0.5
          else:
              scale = None
      if scale is not None:
          for v in betweenness:
              betweenness[v] *= scale
      return betweenness
  
file_path: networkx/networkx/algorithms/centrality/betweenness_subset.py
imports: import networkx
  from networkx.algorithms.centrality.betweenness import _add_edge_keys
  from networkx.algorithms.centrality.betweenness import _single_source_dijkstra_path_basic
  from networkx.algorithms.centrality.betweenness import _single_source_shortest_path_basic
label_desc: Use image node_id 6 for calling a global function with example usage: _rescale_e(betweenness, n, normalized, directed) and returns: betweenness