<commit_before>import re


class Categories(object):
    """
    this class will handle all the functions related to the users
    """
    categories = {}

    def __init__(self, category_name=None, category_owner=None):
        """constructor to initialize the global variables"""

        self.category_name = category_name
        self.category_owner = category_owner

    def create_category(self, category_name, category_owner):

        regexcategory_name = "[a-zA-Z0-9- .]"

        if re.match(regexcategory_name, category_name):

            if category_name != '' and category_name.strip():

                if category_name not in self.categories.keys():

                        self.categories[category_name] = {'cat_name': category_name,
                                                          'cat_owner': category_owner,
                                                          }
                        return "success"
                return "catname_uniqueness"
            return "null_empty_field"
        return "catname_pattern"<commit_msg>[Feature] add view category method<commit_after>import re


class Categories(object):
    """
    this class will handle all the functions related to the users
    """
    categories = {}

    def __init__(self, category_name=None, category_owner=None):
        """constructor to initialize the global variables"""

        self.category_name = category_name
        self.category_owner = category_owner

    def create_category(self, category_name, category_owner):

        regexcategory_name = "[a-zA-Z0-9- .]"

        if re.match(regexcategory_name, category_name):

            if category_name != '' and category_name.strip():

                if category_name not in self.categories.keys():

                        self.categories[category_name] = {'cat_name': category_name,
                                                          'cat_owner': category_owner,
                                                          }
                        return "success"
                return "catname_uniqueness"
            return "null_empty_field"
        return "catname_pattern"

    def view_category(self,category_owner):
        data = self.categories
        my_category = []
        for category in data:
            if data[category]['cat_owner'] == category_owner:
               my_category.append(category)
        return   my_category
{'fraction_non_alphanumeric': 0.08185200496072757, 'fraction_numerical': 0.0016535758577924762, 'mean_word_length': 1.8009259259259258, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3458279', 'n_tokens_mistral': 599, 'n_tokens_neox': 566, 'n_words': 140}