def document_by_value(documents, address, value):
    'Get a specific document by one of its values\n\n    Parameters\n    ----------\n    documents: generator\n        Generator which yields the documents\n    address: str or tuple\n        The address of the data in the document\n    value: any\n        The expected value for the document\n\n    Returns\n    -------\n    dict:\n        The first document which matches the request\n    '
    if isinstance(address, str):
        address = (address,)
    for g_doc in documents:
        doc = deepcopy(g_doc)
        for add in address:
            doc = doc[add]
        if (doc == value):
            return g_doc
Get a specific document by one of its values

Parameters
----------
documents: generator
    Generator which yields the documents
address: str or tuple
    The address of the data in the document
value: any
    The expected value for the document

Returns
-------
dict:
    The first document which matches the request
def document_by_value(documents, address, value):
    'Get a specific document by one of its values\n\n    Parameters\n    ----------\n    documents: generator\n        Generator which yields the documents\n    address: str or tuple\n        The address of the data in the document\n    value: any\n        The expected value for the document\n\n    Returns\n    -------\n    dict:\n        The first document which matches the request\n    '
    if isinstance(address, str):
        address = (address,)
    for g_doc in documents:
        doc = deepcopy(g_doc)
        for add in address:
            doc = doc[add]
        if (doc == value):
            return g_doc