<｜begin▁of▁sentence｜>### Instruction:
Given a directed multigraph with weighted edges described by the edge set { (0, 1, weight=2), (1, 0), (2, 2, weight=3), (2, 2) } and a specified nodelist [0, 1, 2], how would you use the NetworkX function 'to_numpy_array' to create and print the adjacency matrix?
### Response:
import networkx as nx
import numpy as np

# Create a directed graph with weighted edges
G = nx.MultiDiGraph()
G.add_edge(0, 1, weight=2)
G.add_edge(1, 0)
G.add_edge(2, 2, weight=3)
G.add_edge(2, 2)

# Specify nodelist for ordering
nodelist = [0, 1, 2]

# Convert graph to NumPy adjacency matrix
A = nx.to_numpy_array(G, nodelist=nodelist, dtype=float, order='C', multigraph_weight=sum, weight='weight', nonedge=0.0)

# Print the adjacency matrix
print(A)
<|EOT|>
