def METHOD_NAME(query, mol, flags):
    print("Query: %s" % (query.smiles()))
    print("Molecule: %s" % (mol.smiles()))
    matcher = indigo.substructureMatcher(mol, flags)
    matches = matcher.iterateMatches(query)
    for mapping in matches:
        checkMatch(query, mapping)