<｜begin▁of▁sentence｜>### Instruction:
As a construction manager, imagine overseeing the development of a new building complex, where you have a network of 100 different subcontractors. In this network, there's a 10% chance that any two subcontractors have previously worked together – essentially a working relationship. Now, you've been asked to use the Degree-corrected Erdos-Reyni model, a statistical method from the graspologic toolkit, to evaluate this network.

Could you consider applying the DCER model from graspologic to analyze the existing subcontractor relationship network? The goal would be to generate a new, comparable network model that mirrors the same expected working relationship patterns as the original. Upon completion, you'd need to showcase the relationships in both the original and the new network through their adjacency matrices, which are essentially blueprints that map out all the possible subcontractor connections. This exercise would help in understanding the distribution of working relationships and assist in the planning of resource and personnel coordination for future projects.
### Response:
import numpy as np
import networkx as nx
from graspologic.models import DCEREstimator

# Generating a synthetic directed graph with 100 nodes and poisson-distributed random edges
np.random.seed(42)
edge_prob = 0.1
size_graph = 100
G = nx.fast_gnp_random_graph(size_graph, edge_prob, directed=True)

# Initializing and fitting the Degree-corrected Erdos-Reyni Model
model = DCEREstimator(directed=True, loops=False, degree_directed=False)
model.fit(G)

# Extracting the fitted parameters
p_ = model.p_
degree_corrections_ = model.degree_corrections_

# Sampling a new graph from the fitted model
new_graph_sample = model.sample(1)[0]

# Displaying the original and sampled adjacency matrices
original_adj_matrix = nx.to_numpy_array(G)
sampled_adj_matrix = nx.to_numpy_array(nx.DiGraph(new_graph_sample))

print('Original Adjacency Matrix:\n', original_adj_matrix)
print('\nSampled Adjacency Matrix from DCER Model:\n', sampled_adj_matrix)
<|EOT|>
