<commit_before>import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit


class Latvian_ThemePlugin(plugins.SingletonPlugin):
    plugins.implements(plugins.IConfigurer)

    # IConfigurer

    def update_config(self, config_):
        toolkit.add_template_directory(config_, 'templates')
        toolkit.add_public_directory(config_, 'public')
        toolkit.add_resource('fanstatic', 'latvian_theme')


class Latvian_AuthPlugin(plugins.SingletonPlugin):
    plugins.implements(plugins.IAuthFunctions)
    
    def auth_user_list(self, context, data_dict):
        user = context["model"].User.get(context.get('user'))
        #ignore_auth is used in email sending code
        if context.ignore_auth is True:
            return {'success': True}
        #sysadmin can see anything
        elif user.sysadmin:
            return {'success': True}
        #all else fails
        else:
            return {'success': False}

    #IAuthFunctions
    def get_auth_functions(self):
        return {"user_list": self.auth_user_list}<commit_msg>Fix for a small problem<commit_after>import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit


class Latvian_ThemePlugin(plugins.SingletonPlugin):
    plugins.implements(plugins.IConfigurer)

    # IConfigurer

    def update_config(self, config_):
        toolkit.add_template_directory(config_, 'templates')
        toolkit.add_public_directory(config_, 'public')
        toolkit.add_resource('fanstatic', 'latvian_theme')


class Latvian_AuthPlugin(plugins.SingletonPlugin):
    plugins.implements(plugins.IAuthFunctions)
    
    def auth_user_list(self, context, data_dict):
        user = context["model"].User.get(context.get('user'))
        #ignore_auth is used in email sending code
        if context.get('ignore_auth') is True:
            return {'success': True}
        #sysadmin can see anything
        elif user.sysadmin:
            return {'success': True}
        #all else fails
        else:
            return {'success': False}

    #IAuthFunctions
    def get_auth_functions(self):
        return {"user_list": self.auth_user_list}
{'fraction_non_alphanumeric': 0.09505882352941177, 'fraction_numerical': 0.0, 'mean_word_length': 3.2266401590457257, 'pattern_counts': {'":': 2, '<': 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': '4416623', 'n_tokens_mistral': 612, 'n_tokens_neox': 600, 'n_words': 135}