class_docstr: Abstract class :class:`Reporter` for result visualisation.
docstr: Load history from a database supplied as a path to a file or a
  :obj:`tinydb.TinyDB` object.
  
  Args:
      database: :obj:`str` or :obj:`tinydb.TinyDB`. The database to load.
      table: (optional) :obj:`str`. The table to load from the database.
          This argument is not required if the database has only one table.
  
  Raises:
      :class:`ValueError`: if the database contains more than one table
          and `table` is not given.
docstr_tok: ["Load","history","from","a","database","supplied","as","a","path","to","a","file","or","a",":","obj",":","`","tinydb.TinyDB","`","object",".","Args",":","database",":",":","obj",":","`","str","`","or",":","obj",":","`","tinydb.TinyDB","`",".","The","database","to","load",".","table",":","(","optional",")",":","obj",":","`","str","`",".","The","table","to","load","from","the","database",".","This","argument","is","not","required","if","the","database","has","only","one","table",".","Raises",":",":","class",":","`","ValueError","`",":","if","the","database","contains","more","than","one","table","and","`","table","`","is","not","given","."]
code: def from_database(
      self, database: Union[str, tinydb.TinyDB], table: str = None
  ):
      """Load history from a database supplied as a path to a file or a
      :obj:`tinydb.TinyDB` object.
  
      Args:
          database: :obj:`str` or :obj:`tinydb.TinyDB`. The database to load.
          table: (optional) :obj:`str`. The table to load from the database.
              This argument is not required if the database has only one table.
  
      Raises:
          :class:`ValueError`: if the database contains more than one table
              and `table` is not given.
      """
      if isinstance(database, str):
          db = tinydb.TinyDB(
              database, sort_keys=True, indent=4, separators=(",", ": ")
          )
      elif isinstance(database, tinydb.TinyDB):
          db = database
      else:
          raise TypeError(
              "The database must be of type str or tinydb.TinyDB."
          )
      if len(db.tables()) > 1 and table is None:
          raise ValueError(
              "Ambiguous database with multiple tables. "
              "Specify a table name."
          )
      if table is None:
          table = list(db.tables())[0]
      self._db = db
      self._db_default_table = self._db.table(table)
  
imports: import abc
  import datetime
  import os
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import tinydb
  from hypertunity.domain import Domain, Sample
  from hypertunity.optimisation.base import EvaluationScore, HistoryPoint
label_desc: Use image node_id 11 for calling the Reporter obj's underlying member method code with example usage: obj.from_database(database, table) without return types