Load a factory and have it initialize in a particular directory
    :param name: the name of the plugin to load
    :param directory: the directory where the factory will reside
    :return:

def load_factory(name, directory, configuration=None):
    """ Load a factory and have it initialize in a particular directory
    :param name: the name of the plugin to load
    :param directory: the directory where the factory will reside
    :return:
    """
    for entry_point in pkg_resources.iter_entry_points(ENTRY_POINT):
        if entry_point.name == name:
            factory_class = entry_point.load(require=False)
            return factory_class(directory, configuration)

    raise KeyError