def pos_in_rect(rect, pos):
    """Return True if pos is in the rectangle"""
    pos_x, pos_y = pos
    x, y, width, height = rect
    return (x <= pos_x <= x + width
            and y <= pos_y <= y + height)