def with_y(p1, a2):
    """Returns the first argument (a coordinate pair) with the x value replaced with
    the second argument."""
    try:
        return p1[0], a2[1]
    except TypeError:
        return p1[0], a2
