code: def check_in_ase(atoms, ase_db, energy=None):
      
  
      db_ase = ase.db.connect(ase_db)
      if energy is None:
          energy = atoms.get_potential_energy()
      formula = get_chemical_formula(atoms)
      rows = db_ase.select(energy=energy)
      n = 0
      ids = []
      for row in rows:
          if formula == row.formula:
              n += 1
              ids.append(row.id)
      if n > 0:
          id = ids[0]
          unique_id = db_ase.get(id)['unique_id']
          return id, unique_id
      else:
          return None, None
docs: Check if entry is allready in ASE db