<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edges set [(0, 1), (2, 1), (2, 3)], can you check if the graph is weakly connected using NetworkX?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()

# Add edges to the graph
G.add_edges_from([(0, 1), (2, 1), (2, 3)])

# Check if the directed graph is weakly connected
is_weak = nx.is_weakly_connected(G)
print('Is the graph weakly connected?', is_weak)
<|EOT|>
