<｜begin▁of▁sentence｜>### Instruction:
Imagine you're a choreographer and you're working on a new production that involves two dance troupes – let's call them troupe A and troupe B. In this production, dancers don't strictly belong to one troupe or another but they can move fluidly between the two, based on the style of the dance. This is a bit like a Mixed Membership Stochastic Block Model (MMSBM), where each dancer (or node) in the production (or network) has mixed membership across two troupes (or communities).

You've outlined a choreography matrix that represents the likelihood of dancers partnering up for duets, based on their troupe affiliation. In addition to this, you have a rehearsal schedule (or, the Dirichlet parameter) that outlines how dancers distribute their time between the two troupes.

With this in mind, how would you bring this production to life, capturing the various dancer pairings in a dance sequence matrix (akin to retrieving the adjacency matrix)? And, how would you keep track of which troupe each dancer is expressing at a given time during the performance (equivalent to retrieving the community memberships of each node or dancer interaction)?
### Response:
import numpy as np
from graspologic.simulations import mmsbm

# Seed the random number generator for reproducibility
rng = np.random.default_rng(1)
np.random.seed(1)

# Define the parameters for MMSBM
n = 50  # number of nodes
p = [[0.7, 0.2], [0.2, 0.8]]  # block connectivity matrix
alpha = [0.3, 0.7]  # dirichlet distribution parameter

# Generate a graph sample from MMSBM
A, labels = mmsbm(n, p, alpha, rng=rng, return_labels=True)

print('Adjacency Matrix:\n', A)
print('Labels Matrix:\n', labels)
<|EOT|>
