<｜begin▁of▁sentence｜>### Instruction:
Given a set of random latent positions generated from a 2-dimensional Dirichlet distribution, how can you use the `rdpg` function from graspologic to sample both binary and weighted random graphs? Provide an example that includes the generation of latent positions, sampling a binary graph, and then a weighted graph with a Poisson(2) distribution for the edge weights.
### Response:
import numpy as np
from graspologic.simulations import rdpg

# Seed for reproducibility
np.random.seed(1)

# Generate random latent positions using 2-dimensional Dirichlet distribution.
X = np.random.dirichlet([1, 1], size=5)

# Sample a binary RDPG using sampled latent positions.
A = rdpg(X, loops=False)
print(A)

# Sample a weighted RDPG with Poisson(2) weight distribution
wt = np.random.poisson
wtargs = {'lam': 2}
A_weighted = rdpg(X, loops=False, wt=wt, wtargs=wtargs)
print(A_weighted)
<|EOT|>
