def strip_file_handles(results):
    """Return a database result set with all file handle objects removed.abs

    Utility function to aid comparison of database entries. As file handles are
    created newly each object, these are always different so can be excluded.
    """

    if not isinstance(results, (list, tuple)):
        results = [results]

    cleaned_results = []
    for result in results:
        sources = result["experiment"]["sources"]
        artifacts = result["artifacts"]
        resources = result["resources"]
        if sources:
            for src in sources:
                if isinstance(src[-1], io.BufferedReader):
                    del src[-1]
        if artifacts:
            for art in artifacts:
                if isinstance(art[-1], io.BufferedReader):
                    del art[-1]
        if resources:
            for res in resources:
                if isinstance(res[-1], io.BufferedReader):
                    del res[-1]
        cleaned_results.append(result)

    return cleaned_results
Return a database result set with all file handle objects removed.abs

    Utility function to aid comparison of database entries. As file handles are
    created newly each object, these are always different so can be excluded.
    
tests/test_observers/test_tinydb_reader.py