code: def test_search_function(tmpdir):
      # Setup and run three experiments
      root = tmpdir.strpath
      run_test_experiment(
          exp_name="experiment 1 alpha", exp_id="1234", root_dir=root
      )
      run_test_experiment(
          exp_name="experiment 2 beta", exp_id="5678", root_dir=root
      )
      run_test_experiment(
          exp_name="experiment 3 alpha beta",
          exp_id="9990",
          root_dir=root,
      )
  
      tinydb_reader = TinyDbReader(root)
  
      # Test Fetch by Tinydb Query in search function
      record = Query()
      q = record.experiment.name.search("experiment [23]")
  
      res = tinydb_reader.search(q)
      assert len(res) == 2
      res2 = tinydb_reader.fetch_metadata(query=q)
      assert strip_file_handles(res) == strip_file_handles(res2)
  
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 9 for calling a global function with example usage: test_search_function(tmpdir) without return types