<｜begin▁of▁sentence｜>### Instruction:
How can we apply the Degree-Corrected Stochastic Block Model to examine the community structure in a famous social network such as the Zachary's Karate Club graph?
### Response:
import numpy as np
from graspologic.models import DCSBMEstimator
import networkx as nx

# Construct a graph using NetworkX
G = nx.karate_club_graph()

# Convert the graph to an adjacency matrix
adjacency_matrix = nx.to_numpy_array(G)

# Fit the Degree-Corrected Stochastic Block Model
estimator = DCSBMEstimator(directed=False, degree_directed=False, loops=False)
estimator.fit(adjacency_matrix)

# Get the estimated block probability matrix
block_p = estimator.block_p_

# Get the degree correction terms
degree_corrections = estimator.degree_corrections_

# Get the vertex assignments to blocks
vertex_assignments = estimator.vertex_assignments_

print('Block probability matrix:\n', block_p)
print('Degree corrections:\n', degree_corrections)
print('Vertex assignments to blocks:\n', vertex_assignments)
<|EOT|>
