<commit_before>import os
"""
Resource locator helps locates files and other resources.

cls.ROOT_PATH get set in the locator file
"""
class ResourceLocator(object):

    ROOT_PATH  = None

    def __init__(self,root_path):
        super().__init__()
        self.ROOT_PATH = root_path

    @staticmethod
    def get_locator(cls,relative_path=None):
        """
        get_locator - returns a resource locator within the project directory
        :param relative_path: specify a path relative to the projects ROOT_PATH
        """
        path = relative_path
        locator = ResourceLocator(path)
        if cls.ROOT_PATH is None:
            if relative_path is None:
                raise NoPathSpecified("No ROOT_PATH or relative_path specified")
        else:
            path = os.join(cls.ROOT_PATH,relative_path)

        if not os.path.isdir(path):
            raise NonExistentDirectory("Folder non existent ", path)
        locator = ResourceLocator(path)

        return locator

class NonExistentDirectory(Exception):
    def __init__(self, message, errors):
        super().__init__(message)
        self.errors = errors

class NoPathSpecified(Exception):
    def __init__(self, message, errors):
        super().__init__(message)
        self.errors = errors<commit_msg>remove complexity default relative arg is empty string<commit_after>import os
"""
Resource locator helps locates files and other resources.

cls.ROOT_PATH get set in the locator file
"""
class ResourceLocator(object):

    ROOT_PATH  = None

    def __init__(self,root_path):
        super().__init__()
        self.ROOT_PATH = root_path

    @classmethod
    def get_locator(cls,relative_path=""):
        """
        get_locator - returns a resource locator within the project directory
        :param relative_path: specify a path relative to the projects ROOT_PATH
        """
        path = relative_path
        if cls.ROOT_PATH is None:
            raise NoPathSpecified("No ROOT_PATH specified")
        path = os.path.join(cls.ROOT_PATH,relative_path)
        if not os.path.isdir(path):
            raise NonExistentDirectory("Folder non existent ", path)
        locator = ResourceLocator(path)
        return locator

class NonExistentDirectory(Exception):
    def __init__(self, message, errors):
        super().__init__(message)
        self.errors = errors

class NoPathSpecified(Exception):
    def __init__(self, message, errors):
        super().__init__(message)
        self.errors = errors
{'fraction_non_alphanumeric': 0.08086469175340272, 'fraction_numerical': 0.0, 'mean_word_length': 2.815267175572519, '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': '6697020', 'n_tokens_mistral': 688, 'n_tokens_neox': 678, 'n_words': 195}