def sides_parallel(coords, clockwise=True):
    """
    Takes a 5-tuple of (x, y) coordinate tuples for a clockwise or
    counterclockwise quadrilateral. Assumes coordinates start at
    (min_x, min_y) and end at (min_x, min_y). Returns True if the
    coordinates define a rectangle. Otherwise returns False.
    """
    if len(coords) != 5:  # pragma: no cover
        raise ValueError('quadrilateral must contain exactly 5 coordinates')

    # get coordinates for [bottom left, top left, top right, bottom right]
    if clockwise:
        corners = [coords[0], coords[1], coords[2], coords[3]]
    else:
        corners = [coords[0], coords[3], coords[2], coords[1]]

    # get (x, y) values for each corner
    (c0_min_x, c0_min_y) = corners[0]   # bottom left
    (c1_min_x, c1_max_y) = corners[1]   # top left
    (c2_max_x, c2_max_y) = corners[2]   # top right
    (c3_max_x, c3_min_y) = corners[3]   # bottom right

    left_rt_parallel = (c0_min_x == c1_min_x and c2_max_x == c3_max_x)
    top_btm_parallel = (c0_min_y == c3_min_y and c1_max_y == c2_max_y)

    has_width = (c0_min_x != c2_max_x and c1_min_x != c3_max_x)
    has_height = (c0_min_y != c1_max_y and c3_min_y != c2_max_y)

    return left_rt_parallel and top_btm_parallel and has_width and has_height