def has_value(key, target, epsilon=0.1):
    """Returns a function that computes whether a specified value in a dict
    is within ``epsilon`` of ``target``.

    The output function takes in a dict ``d`` and returns ``True`` if the
    absolute difference between ``d[key]`` and ``target`` is less than
    ``epsilon``.

    Args:
        key: Lookup key for the value in the dict to compare.
        target: The value to compare against.
        epsilon: Maximum difference between the two values.
    
    Returns:
        A function that takes a dict and returns ``True`` if the absolute value
        between ``dict[key]`` and ``target`` is less than ``epsilon``.
    """
    return lambda bbox: abs(bbox[key] - target) < epsilon
