<｜begin▁of▁sentence｜>### Instruction:
Given the Internet Graph which you can read from a GML file named as-22july06.gml, can you use the surprise_communities function in cdlib to perform community detection? And can you compute the Surprise metric to evaluate the quality of the partitioning?
### Response:
import networkx as nx
from cdlib import algorithms

# Read the graph from 'as-22july06.gml'
G = nx.read_gml('as-22july06.gml')

# Apply the Surprise communities algorithm to the internet graph
coms = algorithms.surprise_communities(G)

# Compute the Surprise metric
surprise_value = coms.surprise()

# Print the Surprise value for the detected communities
print(surprise_value)
<|EOT|>
