docstr: Return all metadata for matching experiment name, index or query.
docstr_tok: ["Return","all","metadata","for","matching","experiment","name",",","index","or","query","."]
code: def fetch_metadata(self, exp_name=None, query=None, indices=None):
      """Return all metadata for matching experiment name, index or query."""
      from tinydb import Query
  
      if exp_name or query:
          if query:
              q = query
          elif exp_name:
              q = Query().experiment.name.search(exp_name)
  
          entries = self.runs.search(q)
  
      elif indices or indices == 0:
          if not isinstance(indices, (tuple, list)):
              indices = [indices]
  
          num_recs = len(self.runs)
  
          for idx in indices:
              if idx >= num_recs:
                  raise ValueError(
                      "Index value ({}) must be less than "
                      "number of records ({})".format(idx, num_recs)
                  )
  
          entries = [self.runs.all()[ind] for ind in indices]
  
      else:
          raise ValueError(
              "Must specify an experiment name, indicies or "
              "pass custom query"
          )
  
      return entries
  
imports: from __future__ import division, print_function, unicode_literals, absolute_import
  import os
  import textwrap
  import uuid
  from collections import OrderedDict
  import warnings
  from sacred.__about__ import __version__
  from sacred.commandline_options import cli_option
  from sacred.observers import RunObserver
label_desc: Use image node_id 5 for calling the TinyDbReader obj's underlying member method code with example usage: obj.fetch_metadata(exp_name, query, indices) and returns: entries