<｜begin▁of▁sentence｜>### Instruction:
Given a graph with edge set [(0, 1), (0, 2), (1, 3), (1, 4), (2, 5), (2, 6)], how do you use the Dendrogram object to create a hierarchical clustering and cut it at level 2 to obtain two clusters?
### Response:
import igraph as ig

# Construct a graph
edges = [(0, 1), (0, 2), (1, 3), (1, 4), (2, 5), (2, 6)]
graph = ig.Graph(edges=edges)

# Perform hierarchical clustering (Agglomerative)
dendrogram = graph.community_edge_betweenness()

# Create Dendrogram object from merge history
merges = dendrogram.merges
d = ig.Dendrogram(graph, merges=merges)

# Cut the dendrogram at level 2 to get two clusters
clusters = d.as_clustering(2)
print(clusters)
<|EOT|>
