<｜begin▁of▁sentence｜>### Instruction:
Given an `Erdos-Renyi` random graph with 10 nodes and a 50% chance of edge creation between any pair of nodes, can you iterate over the clusters created by the `community_multilevel` clustering algorithm and print them as lists of nodes in JSON format?
### Response:
from igraph import Graph
import json

# Create a sample graph
g = Graph.Erdos_Renyi(n=10, p=0.5)

# Perform a community detection algorithm to create clusters
clustering = g.community_multilevel()

# Iterate over the clusters and convert them to lists
clusters_as_lists = [list(cluster) for cluster in clustering]

# Print the clusters
print(json.dumps(clusters_as_lists, indent=2))
<|EOT|>
