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 '_type' in data
