<commit_before># -*- coding: utf-8 -*-


def test_node():
    """Assert node class is created with specified val."""
    from dll import Node
    new_node = Node(4)
    assert new_node.val == 4


def test_double_linked_list():
    """Assert a doubly linked list is created."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    assert my_list.head is None


def test_insert_on_empty_list():
    """Assert insert works."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    assert my_list.head.val == 4


def test_insert_on_non_emtpy_list():
    """Assert insert on non-empty list works."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    my_list.insert('Diana')
    assert my_list.head.val == 'Diana'


# TODO figure out how to test prvious node
def test_assert_previous():
    """Assert second node points to its previous."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert('Daniel')
    my_list.insert('Diana')
    assert my_list.head.val == 'Diana'


def test_tail():
    """Assert the last node is the tail."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    my_list.insert(5)
    my_list.insert(6)
    assert my_list.tail.val == 4


def test_append_non_empty():
    """Assert node gets appended to the end of the lsit."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    my_list.append(8)
    assert my_list.tail.val == 8


def test_append_empty():
    """Assert node gets appended to empty list."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.append(4)
    assert my_list.tail.val == 4


def test_pop_non_empty():
    """Assert first node gets removed and returned."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    my_list.insert(5)
    assert my_list.pop() == 5



<commit_msg>Start shift method/tests<commit_after># -*- coding: utf-8 -*-


def test_node():
    """Assert node class is created with specified val."""
    from dll import Node
    new_node = Node(4)
    assert new_node.val == 4


def test_double_linked_list():
    """Assert a doubly linked list is created."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    assert my_list.head is None


def test_insert_on_empty_list():
    """Assert insert works."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    assert my_list.head.val == 4


def test_insert_on_non_emtpy_list():
    """Assert insert on non-empty list works."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    my_list.insert('Diana')
    assert my_list.head.val == 'Diana'


# TODO figure out how to test prvious node
def test_assert_previous():
    """Assert second node points to its previous."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert('Daniel')
    my_list.insert('Diana')
    assert my_list.head.val == 'Diana'


def test_tail():
    """Assert the last node is the tail."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    my_list.insert(5)
    my_list.insert(6)
    assert my_list.tail.val == 4


def test_append_non_empty():
    """Assert node gets appended to the end of the lsit."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    my_list.append(8)
    assert my_list.tail.val == 8


def test_append_empty():
    """Assert node gets appended to empty list."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.append(4)
    assert my_list.tail.val == 4


def test_pop_non_empty():
    """Assert first node gets removed and returned."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(4)
    my_list.insert(5)
    assert my_list.pop() == 5


def test_shift():
    """Assert shift works on non empty list."""
    from dll import DoublyLinkedList
    my_list = DoublyLinkedList()
    my_list.insert(1)
    my_list.insert(2)
    my_list.insert(3)
    assert my_list.shift() == 1



{'fraction_non_alphanumeric': 0.10572892408011178, 'fraction_numerical': 0.009315323707498836, 'mean_word_length': 3.32527693856999, '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': '2517841', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1385, 'n_words': 395}