<｜begin▁of▁sentence｜>### Instruction:
Given the Political blogs Graph read from a gml file named polblogs.gml, can you use the Louvain method in cdlib to detect communities and compute the Triangle Participation Ratio, which is the fraction of community nodes that belong to a triad?
### Response:
import networkx as nx
from cdlib import algorithms, evaluation

# Load a graph
G = nx.read_gml('polblogs.gml')

# Detect communities using the Louvain method
communities = algorithms.louvain(G)

# Calculate the Triangle Participation Ratio
triangle_participation = evaluation.triangle_participation_ratio(G, communities)

# Print the Triangle Participation Ratio
print(triangle_participation)
<|EOT|>
