<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with the edge set [(1, 2), (1, 3), (2, 3), (3, 1), (5, 6), (5, 4), (6, 7)], can you use the 'triads_by_type' function from NetworkX to classify and list all triads by their types?
### Response:
import networkx as nx

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

# Calculate triads by type
triads_dict = nx.triads_by_type(G)

# Access triad type '120C'
triad_120C_edges = triads_dict['120C'][0].edges()
print('Edges for triad type 120C:', triad_120C_edges)

# Access triad type '012'
triad_012_edges = triads_dict['012'][0].edges()
print('Edges for triad type 012:', triad_012_edges)
<|EOT|>
