human
Complete this python program:
def _create_fake_extension(name, has_factory_func=True, is_wrong_type=False, use_old_style=False):
assistant
#Here is the Python code you requested.

    """Create a fake extension module for testing.
    """
    if use_old_style:
        mod_name = u'_'.join([u'mdx', name])
    else:
        mod_name = name
    if (not PY3):
        mod_name = bytes(mod_name)
    ext_mod = types.ModuleType(mod_name)
    def makeExtension(*args, **kwargs):
        if is_wrong_type:
            return object
        else:
            return markdown.extensions.Extension(*args, **kwargs)
    if has_factory_func:
        ext_mod.makeExtension = makeExtension
    sys.modules[mod_name] = ext_mod