<commit_before>import logging
import unicodedata
import requests

__author__ = ('nlw', 'tec')
logger = logging.getLogger(__name__)


class DipperUtil:
    """
    Various utilities and quick methods used in this application

    """

    def remove_control_characters(self, s):
        return "".join(ch for ch in s if unicodedata.category(ch)[0] != "C")

    @staticmethod
    def get_ncbi_taxon_num_by_label(label):
        """
        Here we want to look up the NCBI Taxon id using some kind of label.
        It will only return a result if there is a unique hit.
        :return:
<commit_msg>comment add char classes being stripped<commit_after>import logging
import unicodedata
import requests

__author__ = ('nlw', 'tec')
logger = logging.getLogger(__name__)


class DipperUtil:
    """
    Various utilities and quick methods used in this application

    """

    def remove_control_characters(self, s):
        '''
        Filters out charcters in any of these unicode catagories
        [Cc] 	Other, Control      ( 65 characters) \n,\t ...
        [Cf] 	Other, Format       (151 characters)
        [Cn] 	Other, Not Assigned (  0 characters -- none have this property)
        [Co] 	Other, Private Use  (  6 characters)
        [Cs] 	Other, Surrogate    (  6 characters)
        '''
        return "".join(ch for ch in s if unicodedata.category(ch)[0] != "C")

    @staticmethod
    def get_ncbi_taxon_num_by_label(label):
        """
        Here we want to look up the NCBI Taxon id using some kind of label.
        It will only return a result if there is a unique hit.
        :return:

{'fraction_non_alphanumeric': 0.08796007485963818, 'fraction_numerical': 0.006238303181534623, 'mean_word_length': 2.63718820861678, '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': '4196439', 'n_tokens_mistral': 497, 'n_tokens_neox': 469, 'n_words': 176}