<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _load_plugins(plugin_paths, plugins, plugin_filter, base_url, internal_attributes, callback):
 """ Loads endpoint plugins :type plugin_paths: list[str] :type plugins: list[str] :type plugin_filter: (type | str) -> bool :type internal_attributes: dict[string, dict[str, str | list[str]]] :rtype list[satosa.plugin_base.endpoint.InterfaceModulePlugin] :param plugin_paths: Path to the plugin directory :param plugins: A list with the name of the plugin files :param plugin_filter: Filter what to load from the module file :param args: Arguments to the plugin :return: A list with all the loaded plugins """

    loaded_plugin_modules = []
    with prepend_to_import_path(plugin_paths):
        for plugin_config in plugins:
            try:
                module_class = _load_endpoint_module(plugin_config, plugin_filter)
            except SATOSAConfigurationError as e:
                raise SATOSAConfigurationError("Configuration error in {}".format(json.dumps(plugin_config))) from e

            if module_class:
                module_config = _replace_variables_in_plugin_module_config(plugin_config["config"], base_url,
                                                                           plugin_config["name"])
                instance = module_class(callback, internal_attributes, module_config, base_url,
                                        plugin_config["name"])
                loaded_plugin_modules.append(instance)
    return loaded_plugin_modules