<commit_before>from __future__ import division  # take the division operator from future versions
import numpy as np

__author__ = 'GuillaumeBeaud'


# Abstract class for loss functions so they share the same interface and all have the rho, psi, weights functions
class LossFunction:
    def __init__(self, clipping=None):  # Constructor of the class
        if clipping is not None:
            assert clipping > 0  # verifies clipping is >0 if it is not None
            self.clipping = clipping

    # vectorized rho function : applies element-wise rho function to any structure and returns same structure
    def rho(self, array):  # Abstract method, defined by convention only
        raise NotImplementedError("Subclass must implement abstract method")<commit_msg>message<commit_after>from __future__ import division  # take the division operator from future versions
import numpy as np

__author__ = 'GuillaumeBeaud'

"""
Description of package
"""

# Abstract class for loss functions so they share the same interface and all have the rho, psi, weights functions
class LossFunction:
    def __init__(self, clipping=None):  # Constructor of the class
        if clipping is not None:
            assert clipping > 0  # verifies clipping is >0 if it is not None
            self.clipping = clipping

    # vectorized rho function : applies element-wise rho function to any structure and returns same structure
    def rho(self, array):  # Abstract method, defined by convention only
        raise NotImplementedError("Subclass must implement abstract method")
{'fraction_non_alphanumeric': 0.04984025559105431, 'fraction_numerical': 0.0025559105431309905, 'mean_word_length': 3.688622754491018, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '552652', 'n_tokens_mistral': 391, 'n_tokens_neox': 385, 'n_words': 188}