docs: def init_stats(output_dir, config):
      """Init all required ressources for stats handling
      :param str output_dir: the output directory for the results
      :param dict config: the project configuration
      """
  
      try:
          os.makedirs(output_dir, 0o755)
      except OSError as e:
          print("ERROR: Can not create output directory: %s\n" % e)
          raise
  
      db_uri = get_db_uri(config, output_dir)
  
      set_database(db_uri, db, config)
  
      tables_to_create = [t for t in [Result, Turret] if not t.table_exists()]
  
      db.get_conn()
      db.create_tables(tables_to_create)