def check_special_non_rotor_cases(mol, top1, top2):
    """
    Check whether one of the tops correspond to a special case which could not be rotated
    `mol` is the RMG Molecule to diagnose
    `top1` and `top2` are indices of atoms on each side of the pivots, the first index corresponds to one of the pivots

    Special cases considered are:

    - cyano groups: ``R-C#N``
    - azide groups: ``N-N#N``

    These cases have a 180 degree angle and torsion is meaningless, but they are identified by our methods since they
    have a single bond
    Returns `True` if this is indeed a special case which should not be treated as a rotor
    """
    for top in [top1, top2]:
        # check cyano group
        if len(top) == 2 and mol.atoms[top[0] - 1].isCarbon() and mol.atoms[top[1] - 1].isNitrogen() \
                and mol.atoms[top[1] - 1].atomType.label == 'N3t':
            return True
    for tp1, tp2 in [(top1, top2), (top2, top1)]:
        # check azide group
        if len(tp1) == 2 and mol.atoms[tp1[0] - 1].atomType.label == 'N5tc' \
                and mol.atoms[tp1[1] - 1].atomType.label == 'N3t' and mol.atoms[tp2[0] - 1].atomType.label == 'N1sc':
            return True
    return False