<commit_before># encoding: utf-8

"""
.. codeauthor:: <NAME> <<EMAIL>>
"""

from __future__ import absolute_import

from ..interface import TableLoaderInterface


class TableLoaderManager(TableLoaderInterface):

    def __init__(self, loader):
        self.__loader = loader

    @property
    def format_name(self):
        return self.__loader.format_name

    @property
    def source_type(self):
        return self.__loader.source_type

    @property
    def encoding(self):
        try:
            return self.__loader.encoding
        except AttributeError:
            return None

    def load(self):
        return self.__loader.load()

    def inc_table_count(self):
        self.__loader.inc_table_count()<commit_msg>Add an interface to change loading encoding for File/URL loaders<commit_after># encoding: utf-8

"""
.. codeauthor:: <NAME> <<EMAIL>>
"""

from __future__ import absolute_import

from ..interface import TableLoaderInterface


class TableLoaderManager(TableLoaderInterface):

    def __init__(self, loader):
        self.__loader = loader

    @property
    def format_name(self):
        return self.__loader.format_name

    @property
    def source_type(self):
        return self.__loader.source_type

    @property
    def encoding(self):
        try:
            return self.__loader.encoding
        except AttributeError:
            return None

    @encoding.setter
    def encoding(self, codec_name):
        self.__loader.encoding = codec_name

    def load(self):
        return self.__loader.load()

    def inc_table_count(self):
        self.__loader.inc_table_count()
{'fraction_non_alphanumeric': 0.08927464352138871, 'fraction_numerical': 0.0012399256044637321, 'mean_word_length': 2.788732394366197, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2539515', 'n_tokens_mistral': 451, 'n_tokens_neox': 433, 'n_words': 110}