<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with two cycles, one of length 2 and the other of length 3, how can we determine if the graph is aperiodic using NetworkX?
### Response:
import networkx as nx

# Create a directed graph
DG = nx.DiGraph()
# Add edges to construct two cycles with lengths of 2 and 3
DG.add_edge(1, 2)
DG.add_edge(2, 3)
DG.add_edge(3, 1)
DG.add_edge(1, 4)
DG.add_edge(4, 1)
# Check whether the graph is aperiodic
print(nx.is_aperiodic(DG))
<|EOT|>
