def METHOD_NAME(old_factory, new_factory, source):
    return re.sub(
        r"""
        \b{}\b
        """.format(
            old_factory
        ),
        r"{}".format(new_factory),
        source,
        flags=re.VERBOSE,
    )