code: def test_fetch_metadata_function_with_querry(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)
  
      record = Query()
  
      exp1_query = record.experiment.name.matches(".*alpha$")
  
      exp3_query = (record.experiment.name.search("alpha")) & (
          record._id == "9990"
      )
  
      # Test Fetch by Tinydb Query
      res1 = tinydb_reader.fetch_metadata(query=exp1_query)
      assert len(res1) == 1
      assert res1[0]["experiment"]["name"] == "experiment 1 alpha"
  
      res2 = tinydb_reader.fetch_metadata(
          query=record.experiment.name.search("experiment [23]")
      )
      assert len(res2) == 2
  
      res3 = tinydb_reader.fetch_metadata(query=exp3_query)
      assert len(res3) == 1
      assert res3[0]["experiment"]["name"] == "experiment 3 alpha beta"
  
      # Test Exception
      with pytest.raises(ValueError):
          tinydb_reader.fetch_metadata()
  
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 8 for calling a global function with example usage: test_fetch_metadata_function_with_querry(tmpdir) without return types