docs: def import_job(db, calc_id, calc_mode, description, user_name, status,
                 hc_id, datadir):
      """
      Insert a calculation inside the database, if calc_id is not taken
      """
      job = dict(id=calc_id,
                 calculation_mode=calc_mode,
                 description=description,
                 user_name=user_name,
                 hazard_calculation_id=hc_id,
                 is_running=0,
                 status=status,
                 ds_calc_dir=os.path.join('%s/calc_%s' % (datadir, calc_id)))
      db('INSERT INTO job (?S) VALUES (?X)', job.keys(), job.values())