<commit_before>"""Manager to handle plugins"""
from pluginbase import PluginBase


class PluginManager:
    """Class to manage and create Spinnaker applications

    Args:
        paths (str): Path of plugin directory.
        provider (str): The name of the cloud provider.
    """

    def __init__(self, paths, provider):
        self.paths = [paths]
        self.provider = provider

        plugin_base = PluginBase(package='foremast.plugins')
        self.plugin_source = plugin_base.make_plugin_source(searchpath=self.paths)

    def plugins(self):
        """List of all plugins available."""
        for plugin in self.plugin_source.list_plugins():
            yield plugin

    def load(self):
        """Load the plugin object."""
        return self.plugin_source.load_plugin(self.provider)<commit_msg>refactor: PluginManager path begins at package root<commit_after>"""Manager to handle plugins"""
import pathlib

from pluginbase import PluginBase


class PluginManager:
    """Class to manage and create Spinnaker applications

    Args:
        paths (str): Path of plugin directory.
        provider (str): The name of the cloud provider.
    """

    def __init__(self, paths, provider):
        path = pathlib.Path(__file__).parent.resolve()
        path = path / paths

        all_paths = [str(path)]

        self.paths = all_paths
        self.provider = provider

        plugin_base = PluginBase(package='foremast.plugins')
        self.plugin_source = plugin_base.make_plugin_source(searchpath=self.paths)

    def plugins(self):
        """List of all plugins available."""
        for plugin in self.plugin_source.list_plugins():
            yield plugin

    def load(self):
        """Load the plugin object."""
        return self.plugin_source.load_plugin(self.provider)
{'fraction_non_alphanumeric': 0.0966129927817879, 'fraction_numerical': 0.0, 'mean_word_length': 2.8752688172043013, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3373004', 'n_tokens_mistral': 484, 'n_tokens_neox': 461, 'n_words': 144}