code: def get_db_file_manager(root_dir) -> Tuple[TinyDB, HashFS]:
      root_dir = Path(root_dir)
      fs = HashFS(
          root_dir / "hashfs", depth=3, width=2, algorithm="md5"
      )
  
      # Setup Serialisation object for non list/dict objects
      serialization_store = SerializationMiddleware()
      serialization_store.register_serializer(
          DateTimeSerializer(), "TinyDate"
      )
      serialization_store.register_serializer(
          FileSerializer(fs), "TinyFile"
      )
  
      if opt.has_numpy:
          serialization_store.register_serializer(
              NdArraySerializer(), "TinyArray"
          )
      if opt.has_pandas:
          serialization_store.register_serializer(
              DataFrameSerializer(), "TinyDataFrame"
          )
          serialization_store.register_serializer(
              SeriesSerializer(), "TinySeries"
          )
  
      db = TinyDB(
          os.path.join(root_dir, "metadata.json"),
          storage=serialization_store,
      )
      return db, fs
  
imports: import datetime
  import json
  import os
  from io import BufferedReader, FileIO
  from pathlib import Path
  from typing import Tuple
  from hashfs import HashFS
  from tinydb import TinyDB
  from tinydb_serialization import Serializer, SerializationMiddleware
  import sacred.optional
label_desc: Use image node_id 1 for calling a global function with example usage: get_db_file_manager(root_dir) and returns: db,  fs