<commit_before>from __future__ import unicode_literals


class Node(object):

    def __init__(self, value):
        self.value = value
        self.next_node = None


class LinkedList(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.sizeOfList == 0:
            self.head = self.tail = new_node
            self.sizeOfList += 1
        else:
            self.tail.next_node = new_node
            self.tail = new_node
            self.sizeOfList += 1

    def pop(self):
        current = self.head
        previous = None
        val = self.tail.value

        if self.sizeOfList  == 1:
            self.head = self.tail = None
            self.sizeOfList -= 1
            return val
        else:
            while current is not self.tail:
                previous = current
                current = current.next_node
            self.tail = previous
            previous.next_node = None
            self.sizeOfList -= 1
            return val

    def size(self):
        return self.sizeOfList

    def display(self):
        current = self.head
        result = ()
        while current is not None:
            result += (current.value,)
            current = current.next_node
        return result

<commit_msg>add new version of queue.py and queue_linked_list.py<commit_after>from __future__ import unicode_literals


class Node(object):

    def __init__(self, value):
        self.value = value
        self.next_node = None


class LinkedList(object):

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

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

    def insert(self, val):
        new_node = Node(val)
        current = self.head

        if current is None:
            self.head = new_node
            self.sizeOfList += 1
        else:
            while current.next_node is not None:
                current = current.next_node
            current.next_node = new_node
            self.sizeOfList += 1


    def pop(self):
        value = self.head.value
        self.head = self.head.next_node
        self.sizeOfList -= 1
        return value

    def size(self):
        return self.sizeOfList

    def display(self):
        current = self.head
        result = ()
        while current is not None:
            result += (current.value,)
            current = current.next_node
        return result
        
{'fraction_non_alphanumeric': 0.0766084046113797, 'fraction_numerical': 0.004090740052063964, 'mean_word_length': 1.5377358490566038, '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': '3908064', 'n_tokens_mistral': 766, 'n_tokens_neox': 723, 'n_words': 205}