<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with an edge set [(1, 2), (2, 3), (3, 4), (4, 1)], does each vertex have the same indegree and outdegree, making the graph a regular digraph?
### Response:
import networkx as nx

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

# Determine if the directed graph is regular
is_reg = nx.is_regular(G)
print('Is the digraph regular?', is_reg)
<|EOT|>
