def _rescale(betweenness,n,normalized,directed=False):
    if normalized is True:
        if n <=2:
            scale=None  # no normalization b=0 for all nodes
        else:
            scale=1.0/((n-1)*(2-n))
    else: # rescale by 2 for undirected graphs
        if not directed:
            scale=1.0/2.0
        else:
            scale=None
    if scale is not None:
        for v in betweenness:
            betweenness[v] *= scale
    return betweenness
dataset/ETHPy150Open gkno/gkno_launcher/src/networkx/algorithms/centrality/betweenness_subset.py/_rescale/swapped operands of `-`