<｜begin▁of▁sentence｜>### Instruction:
Given the Astrophysics collaborations graph which you can read from a GML file named astro-ph.gml, can you use the Louvain method in cdlib to perform community detection and compute the fraction of existing edges (out of all possible edges) leaving the community?
### Response:
import networkx as nx
from cdlib import algorithms, evaluation

G = nx.read_gml('astro-ph.gml')

communities = algorithms.louvain(G)
cut_ratio_score = evaluation.cut_ratio(G, communities)

print(cut_ratio_score)
<|EOT|>
