<commit_before>class Node(object):

    def __init__(self, val):
        self.val = val
        self.next_node = None
        self.prev_node = None


class Dll(object):

    def __init__(self, iterable=None):
        self.sizeOfList = 0
        self.head = None
        self.tail = None

        if iterable is not None:
            for item in iterable:
                self.insert(item)

    def insert(self, val):
        new_node = Node(val)

        if self.head is None:
            self.head = self.tail = new_node
        else:
            new_node.next_node = self.head
            self.head.prev_node = new_node
            self.head = new_node

        self.sizeOfList += 1

    def append(self, val):
        new_node = Node(val)

        if self.head is None:
            self.head = self.tail = new_node
        else:
            self.tail.next_node = new_node
            new_node.prev_node = self.tail
            self.tail = new_node

        self.sizeOfList += 1

    def pop(self):
        if self.head is None:
            raise IndexError
        elif self.head is self.tail:
            val = self.head.val
            self.head = self.tail = None
        else:
            val = self.head.val
            self.head = self.head.next_node
            self.head.prev_node = None
        self.sizeOfList -= 1
        return val

    def shift(self):
        if self.tail is None:
            raise IndexError
        val = self.tail.val
        if self.tail.prev_node is None:
            self.head = self.tail = None
        else:
            self.tail = self.tail.prev_node
            self.tail.next_node = None

        self.sizeOfList -= 1
        return val

    def remove(self, val):

        if self.head is None:
            raise ValueError
        else:
            current = self.head
            while current is not self.tail and current.val != val:
                current = current.next_node

            if current.val == val:
                current.next_node.prev_node
            else:
                raise ValueError
            self.sizeOfList -= 1
        return current

    def size(self):
        return self.sizeOfList

    def display(self):
        current = self.head
        result = ()
        while current is not None:
            result += (current.val,)
            current = current.next_node
        return result<commit_msg>updated remove to fix issues<commit_after>class Node(object):

    def __init__(self, val):
        self.val = val
        self.next_node = None
        self.prev_node = None


class Dll(object):

    def __init__(self, iterable=None):
        self.sizeOfList = 0
        self.head = None
        self.tail = None

        if iterable is not None:
            for item in iterable:
                self.insert(item)

    def insert(self, val):
        new_node = Node(val)

        if self.head is None:
            self.head = self.tail = new_node
        else:
            new_node.next_node = self.head
            self.head.prev_node = new_node
            self.head = new_node

        self.sizeOfList += 1

    def append(self, val):
        new_node = Node(val)

        if self.head is None:
            self.head = self.tail = new_node
        else:
            self.tail.next_node = new_node
            new_node.prev_node = self.tail
            self.tail = new_node

        self.sizeOfList += 1

    def pop(self):
        if self.head is None:
            raise IndexError
        elif self.head is self.tail:
            val = self.head.val
            self.head = self.tail = None
        else:
            val = self.head.val
            self.head = self.head.next_node
            self.head.prev_node = None
        self.sizeOfList -= 1
        return val

    def shift(self):
        if self.tail is None:
            raise IndexError
        val = self.tail.val
        if self.tail.prev_node is None:
            self.head = self.tail = None
        else:
            self.tail = self.tail.prev_node
            self.tail.next_node = None

        self.sizeOfList -= 1
        return val

    def remove(self, val):

        if self.head is None:
            raise ValueError
        else:
            current = self.head
            while current is not self.tail and current.val != val:
                current = current.next_node

            if current.val == val:
                if current is self.head:
                    head = self.head.next_node
                    head.prev_node = None
                else:
                    current.prev_node.next_node = current.next_node
                    current.next_node.prev_node = current.prev_node
            else:
                raise ValueError
            self.sizeOfList -= 1
        return current

    def size(self):
        return self.sizeOfList

    def display(self):
        current = self.head
        result = ()
        while current is not None:
            result += (current.val,)
            current = current.next_node
        return result
{'fraction_non_alphanumeric': 0.07718321066242291, 'fraction_numerical': 0.0023871096081161725, 'mean_word_length': 1.3506311360448808, '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': '266711', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1374, 'n_words': 377}