def atoms_to_bonds(mol, atom_inds):
    """
    Extract bonds indexes corresponding to a list of atom indexes
    """
    bond_inds = []
    for b in mol.GetBonds():
        if (b.GetBeginAtomIdx() in atom_inds and b.GetEndAtomIdx() in atom_inds):
            bond_inds.append(b.GetIdx())
    return bond_inds