<｜begin▁of▁sentence｜>### Instruction:
As a blockchain developer, you are often faced with the need to understand and optimize network structures that mirror decentralized systems. Let's imagine you've been experimenting with a new blockchain-like network designed to facilitate secure transactions within a specific ecosystem. To simulate the communications within this network, you've generated a model using NetworkX—a powerful Python library for the creation, manipulation, and study of complex networks.

Your model comprises a virtual network of nodes, akin to various actors in a blockchain (like users, validators, and contracts), represented by a synthesized graph based on the stochastic block model (SBM). This graph has 150 nodes that are partitioned evenly into 3 distinct communities or 'blocks', intended to mimic clusters in the network (like groups of nodes with similar roles or transaction behaviors). The interaction probabilities within and between these blocks are set by a matrix: p=[[0.25, 0.05, 0.02], [0.05, 0.35, 0.07], [0.02, 0.07, 0.40]]. These probabilities resemble the likelihood of transactions or communication between different types of nodes.

Now, you're at a stage where you want to reverse-engineer this model to see if it truly represents the complex dynamics of your envisioned blockchain network. For this, you turn to Graspologic, a Python package designed to analyze such networks. Specifically, the `SBMEstimator` API in Graspologic is used to infer the community structure and to estimate the original block probabilities from the network structure you've synthesized with NetworkX.

The challenge here is: Can you employ the `SBMEstimator` from Graspologic to perform this reverse-engineering process on your generated network model, and subsequently output the estimated block probability matrix? This estimated matrix is crucial for you to understand the accuracy of your initial assumptions and to refine the communication probabilities within your blockchain-like network for better transaction efficiency and security.
### Response:
import numpy as np
from graspologic.models import SBMEstimator
import networkx as nx

# Generate a stochastic block model graph
G = nx.stochastic_block_model(sizes=[50, 50, 50], p=[[0.25, 0.05, 0.02], [0.05, 0.35, 0.07], [0.02, 0.07, 0.40]])

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

# We create block labels for 150 nodes
block_labels = np.array([0]*50 + [1]*50 + [2]*50)

# Initialize SBMEstimator
sbm_estimator = SBMEstimator(directed=False, loops=False)

# Fit the estimator to the adjacency matrix with the known block labels
sbm_estimator.fit(adjacency_matrix, y=block_labels)

# Print the estimated block probability matrix
print('Block probabilities:', sbm_estimator.block_p_)
<|EOT|>
