<｜begin▁of▁sentence｜>### Instruction:
Certainly! Imagine you're helping a client organize their project workflow, which involves a series of tasks represented by a network diagram. They've outlined the tasks with directed connections indicating the sequence: Task 1 leads to Task 2, Task 2 leads to Task 3, Task 3 leads to Task 4, and Task 4 loops back to Task 1. Your client wants to ensure that each task has an equal number of preceding and following tasks, maintaining a balanced workflow much like a well-organized space. Could you dive into this network with your expertise to confirm if their task sequence represents a uniformly structured, or in technical terms, a 'regular' directed graph?
### Response:
import networkx as nx

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

# Determine if the graph is regular
is_reg = nx.is_regular(G)

print('Is the graph regular?', is_reg)
<|EOT|>
