def get_extension(name):
    extension = next(
        (ext for ext in get_all_extensions() if ext.name == name), None)

    if extension is not None:
        return extension

    raise errors.CannotFindExtension(
        "Cannot find extension with name '{0}'".format(name))
Retrieves extension by name
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/extensions/manager.py/get_extension