def _apply_transform(self, mol, rule):
mols = [mol]<EOL>for n in six.moves.range(<NUM_LIT:20>):<EOL><INDENT>products = {}<EOL>for mol in mols:<EOL><INDENT>for product in [x[<NUM_LIT:0>] for x in rule.RunReactants((mol,))]:<EOL><INDENT>if Chem.SanitizeMol(product, catchErrors=True) == <NUM_LIT:0>:<EOL><INDENT>products[Chem.MolToSmiles(product, isomericSmiles=True)] = product<EOL><DEDENT><DEDENT><DEDENT>if products:<EOL><INDENT>mols = [products[s] for s in sorted(products)]<EOL><DEDENT>else:<EOL><INDENT>return mols[<NUM_LIT:0>] if n > <NUM_LIT:0> else None<EOL><DEDENT><DEDENT>
Repeatedly apply normalization transform to molecule until no changes occur.

        It is possible for multiple products to be produced when a rule is applied. The rule is applied repeatedly to
        each of the products, until no further changes occur or after 20 attempts. If there are multiple unique products
        after the final application, the first product (sorted alphabetically by SMILES) is chosen.