<commit_before>from interface import Eval

class Seq(Eval):
    def __init__( self):
        self.data = None

    def car(self):
        return self.data[0]

    def cdr(self):
        pass

    def cons(self):
        pass

    # The following four functions needed for iterability
    def __iter__(self):
        pass

    def __len__(self):
        pass

    def __contains__(self, e):
        pass

    def __getitem__(self, e):
        pass

    def __eq__(self, rhs):
        if not isinstance(rhs, Seq):
            return False

        if len(self) != len(rhs):
            return False

        for i in range(len(self.data)):
            if not self.data[i] == rhs.data[i]:
                return False

        return True


class List(Seq):
    def __init__(self, l=None):
        super(List, self).__init__()

        if l is None:
            self.data = []
        else:
            self.data = l

    def cdr(self):
        try:
            return List(self.data[1:])
        except:
            return List([])

    def cons(self, e):
        ret = List(self.data[:]) # bugfix 1234977437
        ret.data.insert(0, e)
        return ret

    def eval(self, env, args=None):
        form = self.car().eval(env)

        return form.eval(env, self.cdr())

    def __iter__(self):
        return self.data.__iter__()

    def __len__(self):
        return len(self.data)

    def __contains__(self, e):
        return e in self.data

    def __getitem__(self, e):
        return self.data[e]

    def __repr__(self):
        if self.data == []:
            return "()"

        ret = "(%s" % self.data[0]
        for e in self.data[1:]:
            ret = ret + " %s" % e

        return ret + ")"<commit_msg>Clean up<commit_after>from interface import Eval

class Seq(Eval):
    def __init__( self):
        self.data = None

    def car(self):
        return self.data[0]

    def cdr(self):
        pass

    def cons(self):
        pass

    # The following four functions needed for iterability
    def __iter__(self):
        return self.data.__iter__()

    def __len__(self):
        return len(self.data)

    def __contains__(self, e):
        return e in self.data

    def __getitem__(self, e):
        return self.data[e]

    def __eq__(self, rhs):
        if not isinstance(rhs, Seq):
            return False

        if len(self) != len(rhs):
            return False

        for i in range(len(self.data)):
            if not self.data[i] == rhs.data[i]:
                return False

        return True


class List(Seq):
    def __init__(self, l=None):
        super(List, self).__init__()

        if l is None:
            self.data = []
        else:
            self.data = l

    def cdr(self):
        try:
            return List(self.data[1:])
        except:
            return List([])

    def cons(self, e):
        ret = List(self.data[:]) # bugfix 1234977437
        ret.data.insert(0, e)
        return ret

    def eval(self, env, args=None):
        form = self.car().eval(env)

        return form.eval(env, self.cdr())

    def __repr__(self):
        if self.data == []:
            return "()"

        ret = "(%s" % self.data[0]
        for e in self.data[1:]:
            ret = ret + " %s" % e

        return ret + ")"
{'fraction_non_alphanumeric': 0.12015858493443123, 'fraction_numerical': 0.009149130832570906, 'mean_word_length': 1.6156299840510366, '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': '4383804', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1006, 'n_words': 285}