<｜begin▁of▁sentence｜>### Instruction:
Imagine you're testing a new feature on a social networking app that visualizes the connections between users as a graph. The developers have implemented a function to export this network of friendships into a format that's more readable. For your current test case, you work with a graph represented by the connections [(1, 2), (1, 3), (3, 4)]. Your task is to validate that the export function works correctly by using NetworkX's utility to store the adjacency list representation of this graph. Can you simulate this scenario to demonstrate the feature, where the output file is named 'my_graph.adjlist', and verify that the file includes the correct adjacency list, reflecting the pairings in your test graph?
### Response:
import networkx as nx

@nx.utils.open_file(1, 'w')
def write_graph_to_file(G, file_path):
    nx.write_adjlist(G, file_path)

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

# Write graph to a file
write_graph_to_file(G, 'my_graph.adjlist')
<|EOT|>
