<｜begin▁of▁sentence｜>### Instruction:
Given the requirement to sample a binary Erdos-Renyi (n, m) graph with exactly `n` vertices and `m` edges using graspologic, how can you convert this graph into a NetworkX graph object and visualize it with labels on the nodes?
### Response:
import numpy as np
import networkx as nx
from graspologic.simulations import er_nm

# Set seed for reproducibility
np.random.seed(42)

n = 10  # Number of vertices
m = 15  # Number of edges
directed = False
loops = False

# Sample a binary Erdos Renyi (n, m) graph
A = er_nm(n, m, directed=directed, loops=loops)

# Convert the adjacency matrix to a NetworkX graph
G = nx.from_numpy_array(A)

# Draw the graph
import matplotlib.pyplot as plt
nx.draw(G, with_labels=True)
plt.show()
<|EOT|>
