<｜begin▁of▁sentence｜>### Instruction:
Given a NetworkX graph created with edges (0, 1), (1, 2), and (2, 0), how would you save the graph's layout in DOT format using NetworkX, and how would you use a hypothetical Configuration object's save method to store settings in a file named 'config.cfg'?
### Response:
from networkx.drawing.nx_pydot import write_dot
import networkx as nx

# Create a graph
g = nx.Graph()
g.add_edges_from([(0, 1), (1, 2), (2, 0)])

# Save the graph to a file in DOT format
path_to_dot_file = 'graph.dot'
write_dot(g, path_to_dot_file)

# Assuming we have a Configuration object named `config`
# Save the configuration to a file
config.save('config.cfg')
<|EOT|>
