code: def write_ase(atoms, db_file, stdout=sys.stdout, user=None, data=None, **key_value_pairs):
      
      db_ase = ase.db.connect(db_file)
      _normalize_key_value_pairs_inplace(key_value_pairs)
      id = db_ase.write(atoms, data=data, **key_value_pairs)
      stdout.write('  writing atoms to ASE db row id = {}\n'.format(id))
      unique_id = db_ase.get(id)['unique_id']
      return unique_id
docs: Connect to ASE db