<｜begin▁of▁sentence｜>### Instruction:
Imagine we're crafting a manuscript that details an exploratory tale of a society consisting of 30 unique tribes, each occupying its own territory. Within this societal network, tribes forge alliances with one another with a certain degree of randomness, specifically, there's a 5% chance of any two tribes establishing a diplomatic bond. Our narrative needs to delve into the underlying alliances to uncover the distinct communities that have organically emerged in this complex web of relationships.

In service to this narrative ambition, we seek to employ graspologic's leiden algorithm, an analytical tool akin to a lens that brings the blurred lines of tribal affiliations into sharp focus. As the literary agents privy to the creation of this societal epic, we must interpret the output of the leiden function, deciphering the alliance patterns to reveal the intricate tapestry of community memberships. Each tribe's allegiance to a community must be documented with precision, as this will form the groundwork for the plot's progression.

Thus, our task is to translate the enigmatic code of tribal associations, furnished by the leiden function from graspologic, into the vivid language of storytelling, telling the reader which tribes belong to each emergent community.
### Response:
import networkx as nx
from graspologic.partition import leiden

# Generate a small random graph using networkx
G = nx.erdos_renyi_graph(n=30, p=0.05)

# Use the leiden algorithm to find the best partition of the graph
partition = leiden(graph=G)

# Display the community each node belongs to
for node, community in partition.items():
    print(f'Node: {node} -> Community: {community}')
<|EOT|>
