<｜begin▁of▁sentence｜>### Instruction:
Imagine we're drafting an illustration for a technical manual that describes a network system—a MultiDiGraph, to be exact. This particular system has pathways or connections akin to a complex wiring diagram. There are conduits running between points labeled as '0', '1', and '2', with some pathways allowing for bidirectional flow and others that loop back to the same point.

Now, the connections in our schematic are as follows: a two-way connection between points '0' and '1', although the conduit from '0' to '1' can handle double the capacity—denoted as a weight of 2. There’s also a unique, self-referential loop on point '2', one of which can handle three times the normal capacity (a weight of 3), and another self-referential pathway without a specified capacity.

Our objective is to translate this intricate diagram into a concise matrix format that can easily be represented on a computer. Specifically, we want to convert this network diagram into a matrix using the CSR (Compressed Sparse Row) format for efficient storage. The task at hand involves utilizing a function from the NetworkX library, namely `to_scipy_sparse_array`, to perform this conversion.

Could you explain how we might write our instructions to represent this network's connections within the documentation so that they align with the CSR format and utilize the `to_scipy_sparse_array` function from NetworkX? The matrix should encapsulate all of the weights and directions of our network as initially described, ensuring the data is accurately represented in our technical illustration.
### Response:
import networkx as nx
from scipy.sparse import csr_matrix

# Create a multidigraph.
G = nx.MultiDiGraph()
# Add edges with weights.
G.add_edge(0, 1, weight=2)
G.add_edge(1, 0)
G.add_edge(2, 2, weight=3)
G.add_edge(2, 2)
# Get the scipy sparse array representation of the adjacency matrix.
S = nx.to_scipy_sparse_array(G, nodelist=[0, 1, 2], weight='weight', dtype=int, format='csr')
# Print the scipy CSR matrix.
print(S.toarray())
<|EOT|>
