def is_document(data):
    """ Determine whether :data: is a valid document.

    To be considered valid, data must:
        * Be an instance of dict
        * Have '_type' key in it
    """
    return isinstance(data, dict) and data in '_type'
dataset/ETHPy150Open ramses-tech/nefertari/nefertari/utils/utils.py/is_document/swapped operands of `in`