<｜begin▁of▁sentence｜>### Instruction:
Given a graph (e.g., the Petersen graph from igraph's famous graphs), can you apply a transformation function using igraph's Layout.Layout.transform that flips the graph layout horizontally? The transformation function should receive a tuple of coordinates and return the transformed coordinates tuple.
### Response:
import igraph as ig

# Load a graph
g = ig.Graph.Famous('Petersen')

# Create a layout for the graph
layout = g.layout('kk')

# Define a transformation function
# For example, we flip the layout horizontally
def flip_coordinates(coords):
    x, y = coords
    return (-x, y)

# Apply the transformation to the layout
layout.transform(flip_coordinates)

# Plot the graph with the transformed layout
ig.plot(g, layout=layout)
<|EOT|>
