def position(x1, y1, x2, y2, epsilon=0.1):
    """Returns a function that computes whether a 2D bounding box has certain
    co-ordinates (+/- epsilon).

    The output function takes in a 2D bounding box (dict with keys 'x1', 'x2',
    'y1', 'y2') and returns ``True`` if the absolute difference between the
    dict's values and the specified co-ordinates are all less than ``epsilon``.

    Args:
        x1: Value to compare against the bounding box's 'x1' field.
        y1: Value to compare against the bounding box's 'y1' field.
        x2: Value to compare against the bounding box's 'x2' field.
        y2: Value to compare against the bounding box's 'y2' field.
        epsilon: Maximum difference against specified co-ordinates.
    
    Returns:
        A function that takes a 2D bounding box and returns ``True`` if the
        bounding box's spatial co-ordinates are all within ``epsilon`` of ``x1``,
        ``y1``, ``x2``, and ``y2``.
    """
    return lambda bbox: abs(bbox['x1'] - x1) < epsilon and abs(bbox['y1'] - y1
        ) < epsilon and abs(bbox['x2'] - x2) < epsilon and abs(bbox['y2'] - y2
        ) < epsilon
