code: 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
  
imports: from __future__ import division, print_function, unicode_literals, absolute_import
  import datetime
  import os
  import tempfile
  import io
  import pytest
  from tinydb import Query
  from sacred.dependencies import get_digest
  from sacred.observers.tinydb_hashfs import TinyDbObserver, TinyDbReader
label_desc: Use image node_id 3 for calling a global function with example usage: strip_file_handles(results) and returns: cleaned_results