def calculate_betweenness_centality(graph: BELGraph, number_samples: int = CENTRALITY_SAMPLES) -> Counter:
try:<EOL><INDENT>res = nx.betweenness_centrality(graph, k=number_samples)<EOL><DEDENT>except Exception:<EOL><INDENT>res = nx.betweenness_centrality(graph)<EOL><DEDENT>return Counter(res)<EOL>
Calculate the betweenness centrality over nodes in the graph.

    Tries to do it with a certain number of samples, but then tries a complete approach if it fails.