<commit_before>__author__ = 'vladimir'

# Helper func to remove " ' etc ...

def wrap(string):
    return string.replace("\"", "&quot;").replace("'", "&amp;")


def safe_injection(func):
    def wrapper(cls, jsondata):
        # print cls.__class__<commit_msg>done input wrapper recursive for all objects: lists, dicts, strs<commit_after>__author__ = 'vladimir'


# returns the same obj but with all data wrapped, recursive
def wrap(string):
    if isinstance(string, list):
        i = 0
        while i < len(string):
            string[i] = wrap(string[i])
            i += 1
        return string
    elif isinstance(string, dict):
        for key in string.keys():
            string[key] = wrap(string[key])
        return string
    elif isinstance(string, str):
        return "`{0}`".format(string.replace("\"", "&quot;").replace("'", "&amp;"))


# Helper func to remove " ' and wrap in `
def safe_injection(func):
    def wrapper(cls, jsondata):
        # print cls.__class__
{'fraction_non_alphanumeric': 0.14517766497461929, 'fraction_numerical': 0.003045685279187817, 'mean_word_length': 2.9282868525896415, 'pattern_counts': {'":': 0, '<': 4, '<?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': '5287167', 'n_tokens_mistral': 305, 'n_tokens_neox': 301, 'n_words': 88}