<commit_before>from BinPy import *
from nose.tools import with_setup, nottest


def test_FourBitRegister():

    clock = Clock(1, 50000)
    clock.start()
    test_ffr = FourBitRegister(1, 0, 1, 0, clock, 1)

    assert test_ffr.output() == [1, 0, 1, 0]

    clock.kill()


def test_FourBitRegister2():

    clock = Clock(1, 50000)
    clock.start()
    test_ffr = FourBitRegister2(1, 0, 1, 0, clock, 1, 1)

    assert test_ffr.output() == [1, 0, 1, 0]
    test_ffr.setLoad(0)

    assert test_ffr.output() == [1, 0, 1, 0]

    clock.kill()


def test_ShiftRegister():

    clock = Clock(1, 50000)
    clock.start()
    test_ffr = ShiftRegister([1, 0, 0, 0], clock)

    assert test_ffr.output() == [1, 1, 0, 0]
    assert test_ffr.output() == [1, 1, 1, 0]
    assert test_ffr.output() == [1, 1, 1, 1]

    test_ffr = ShiftRegister([1, 0, 0, 0], clock, circular=1)

    assert test_ffr.output() == [0, 1, 0, 0]
    assert test_ffr.output() == [0, 0, 1, 0]
    assert test_ffr.output() == [0, 0, 0, 1]
    clock.kill()<commit_msg>function name changed from FourBitRegister2 to FourBitLoadRegister<commit_after>from BinPy import *
from nose.tools import with_setup, nottest


def test_FourBitRegister():

    clock = Clock(1, 50000)
    clock.start()
    test_ffr = FourBitRegister(1, 0, 1, 0, clock, 1)

    assert test_ffr.output() == [1, 0, 1, 0]

    clock.kill()


def test_FourBitLoadRegister():

    clock = Clock(1, 50000)
    clock.start()
    test_ffr = FourBitLoadRegister(1, 0, 1, 0, clock, 1, 1)

    assert test_ffr.output() == [1, 0, 1, 0]
    test_ffr.setLoad(0)

    assert test_ffr.output() == [1, 0, 1, 0]

    clock.kill()


def test_ShiftRegister():

    clock = Clock(1, 50000)
    clock.start()
    test_ffr = ShiftRegister([1, 0, 0, 0], clock)

    assert test_ffr.output() == [1, 1, 0, 0]
    assert test_ffr.output() == [1, 1, 1, 0]
    assert test_ffr.output() == [1, 1, 1, 1]

    test_ffr = ShiftRegister([1, 0, 0, 0], clock, circular=1)

    assert test_ffr.output() == [0, 1, 0, 0]
    assert test_ffr.output() == [0, 0, 1, 0]
    assert test_ffr.output() == [0, 0, 0, 1]
    clock.kill()
{'fraction_non_alphanumeric': 0.16532829475673122, 'fraction_numerical': 0.07227208313651394, 'mean_word_length': 3.112621359223301, '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': '3719692', 'n_tokens_mistral': 975, 'n_tokens_neox': 824, 'n_words': 229}