<commit_before>from cement.core import handler
from common import file_len, VersionsFile
from plugins import BasePlugin
import subprocess

def plugins_get():
    plugins = plugins_base_get()

    return_plugins = []
    for p in plugins:
        plugin = Plugin(p)
        return_plugins.append(plugin)

    return return_plugins

def plugins_base_get():
    controllers = handler.list('controller')
    plugins = [c for c in controllers if issubclass(c, BasePlugin)]

    return plugins

class Plugin(object):
    name = None

    plugins_can_enumerate = False
    plugins_wordlist_size = None
    plugins_mtime = None

    themes_can_enumerate = False
    themes_wordlist_size = None
    themes_mtime = None

    interesting_can_enumerate = False
    interesting_urls_size = None

    version_can_enumerate = False
    version_highest = None

    def __init__(self, plugin=None):
        """
            @param plugin as returned by handler.list('controller'). Must
                extend BasePlugin.
        """
        if plugin:

            self.name = plugin.__name__

            if plugin.can_enumerate_plugins:
                self.plugins_can_enumerate = True
                self.plugins_wordlist_size = file_len(plugin.plugins_file)
                # this can fail due to git not being installed on the system or
                # this not being a git repository.
                try:
                    self.plugins_mtime = self.file_mtime(plugin.plugins_file)
                except:
                    pass

            if plugin.can_enumerate_themes:
                self.themes_can_enumerate = True
                self.themes_wordlist_size = file_len(plugin.themes_file)
                try:
                    self.themes_mtime = self.file_mtime(plugin.themes_file)
                except:
                    pass

            if plugin.can_enumerate_interesting:
                self.interesting_can_enumerate = True
                self.interesting_url_size = len(plugin.interesting_urls)

            if plugin.can_enumerate_version:
                versions_file = VersionsFile(plugin.versions_file)
<commit_msg>Remove functionality which resulted in errors on the final product.<commit_after>from cement.core import handler
from common import file_len, VersionsFile
from plugins import BasePlugin
import subprocess

def plugins_get():
    plugins = plugins_base_get()

    return_plugins = []
    for p in plugins:
        plugin = Plugin(p)
        return_plugins.append(plugin)

    return return_plugins

def plugins_base_get():
    controllers = handler.list('controller')
    plugins = [c for c in controllers if issubclass(c, BasePlugin)]

    return plugins

class Plugin(object):
    name = None

    plugins_can_enumerate = False
    plugins_wordlist_size = None
    plugins_mtime = None

    themes_can_enumerate = False
    themes_wordlist_size = None
    themes_mtime = None

    interesting_can_enumerate = False
    interesting_urls_size = None

    version_can_enumerate = False
    version_highest = None

    def __init__(self, plugin=None):
        """
            @param plugin as returned by handler.list('controller'). Must
                extend BasePlugin.
        """
        if plugin:

            self.name = plugin.__name__

            if plugin.can_enumerate_plugins:
                self.plugins_can_enumerate = True
                self.plugins_wordlist_size = file_len(plugin.plugins_file)

            if plugin.can_enumerate_themes:
                self.themes_can_enumerate = True
                self.themes_wordlist_size = file_len(plugin.themes_file)

            if plugin.can_enumerate_interesting:
                self.interesting_can_enumerate = True
                self.interesting_url_size = len(plugin.interesting_urls)

            if plugin.can_enumerate_version:
                versions_file = VersionsFile(plugin.versions_file)

{'fraction_non_alphanumeric': 0.05935021744691737, 'fraction_numerical': 0.0, 'mean_word_length': 2.2556203164029975, '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': '5188993', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1011, 'n_words': 250}