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

# Create a directed graph
G = nx.DiGraph([(1, 2), (2, 3), (3, 1)])

# Check if the graph is a triad
istriad = nx.is_triad(G)

print(istriad)
<|EOT|>
