<｜begin▁of▁sentence｜>### Instruction:
Given sizes of blocks [50, 50, 100] representing the number of nodes in each block and a probability matrix [[0.25, 0.05, 0.02], [0.05, 0.35, 0.07], [0.02, 0.07, 0.40]] representing the density of edges between the nodes of different blocks in a stochastic block model graph, how can you create and analyze such a graph using NetworkX?
### Response:
import networkx as nx

sizes = [50, 50, 100]
probs = [[0.25, 0.05, 0.02], [0.05, 0.35, 0.07], [0.02, 0.07, 0.40]]
G = nx.stochastic_block_model(sizes, probs, seed=42)

print('Number of nodes in the graph:', len(G))
print('Number of edges in the graph:', G.number_of_edges())

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