<｜begin▁of▁sentence｜>### Instruction:
Given the Political blogs Graph which you can read from a gml file named polblogs.gml, can you use the Louvain method in cdlib to perform community detection? And can you save the detected community structure to a CSV file named communities_polblogs.csv?
### Response:
import networkx as nx
from cdlib import algorithms, readwrite
G = nx.read_gml('polblogs.gml')
communities = algorithms.louvain(G)
readwrite.write_community_csv(communities, 'communities_polblogs.csv', delimiter=',')
<|EOT|>
