<｜begin▁of▁sentence｜>### Instruction:
A researcher is interested in exploring the effects of correlation in random Erdös-Rényi graph models. To experiment with this concept, the researcher seeks to generate two correlated graphs, each with 5 vertices, where the probability of an edge existing between any two vertices is 0.5, and the correlation coefficient between the same vertices across the two graphs is 0.3. The graphs should be undirected and should not include self-loops. How can the researcher use the 'er_corr' function from graspologic's simulations module to achieve this?
### Response:
import numpy as np
from graspologic.simulations import er_corr

# Set the random seed for reproducibility
np.random.seed(2)

# Define the number of vertices, probability of edge existence, and correlation
n = 5
p = 0.5
r = 0.3

def generate_correlated_graphs(n, p, r, directed=False, loops=False):
  # Generate a pair of correlated graphs
  G1, G2 = er_corr(n, p, r, directed=directed, loops=loops)
  return G1, G2

# Generate the correlated graphs
graph1, graph2 = generate_correlated_graphs(n, p, r)

# Display the generated adjacency matrices
print("Graph 1 adjacency matrix:\n", graph1)
print("Graph 2 adjacency matrix:\n", graph2)
<|EOT|>
