<｜begin▁of▁sentence｜>### Instruction:
Given group sizes [15, 10, 5], with a probability of edges within groups set to 0.5 and between groups set to 0.05, can you generate a random partition graph using NetworkX, retrieve the partition assignment, and display the number of nodes in the graph and the size of each group?
### Response:
import networkx as nx

# Sizes of groups
sizes = [15, 10, 5]

# Probability of edges within groups
p_in = 0.5

# Probability of edges between groups
p_out = 0.05

# Seed for random number generator
seed = 42

# Create a random partition graph
G = nx.random_partition_graph(sizes, p_in, p_out, seed=seed)

# Get the partition assignment
partition = G.graph['partition']

# Print the number of nodes in the graph
print('Number of nodes:', len(G))

# Print the partition assignment for each group
for i, group in enumerate(partition):
    print('Group', i, 'size:', len(group))
<|EOT|>
