Returns True if the value of a document field is equal to a given value

def _eq(field, value, document):
    """
    Returns True if the value of a document field is equal to a given value
    """
    try:
        return document.get(field, None) == value
    except TypeError:  # pragma: no cover Python < 3.0
        return False