<commit_before>def fibonacci():
    "A lazy stream of Fibonacci numbers."
    a = 0
    b = 1

    while True:
        c = a + b
        a = b
        b = c
        yield c


def index(f):
    "Given a Fibonacci number return its position in the stream."
    i = 0
    for n in fibonacci():
        if f == n:
            return i
        if n > f:
            raise ValueError(str(f) + " is not a fibonacci number")
        i += 1
<commit_msg>Bug in Fibonacci, more error validation.<commit_after>def fibonacci():
    "A lazy stream of Fibonacci numbers starting at 0 (0, 1, 1, 2, 3, 5, ...)."
    a = 0
    b = 1

    yield a
    yield b
    while True:
        c = a + b
        a = b
        b = c
        yield c


def index(f):
    "Given a Fibonacci number return its position in the stream."
    if f < 0:
        raise ValueError("%d is not a fibonacci number" % f)
    for i, n in enumerate(fibonacci()):
        if f == n:
            return i
        if n > f:
            raise ValueError("%d is not a fibonacci number" % f)

{'fraction_non_alphanumeric': 0.09633911368015415, 'fraction_numerical': 0.01348747591522158, 'mean_word_length': 1.5591133004926108, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '5488344', 'n_tokens_mistral': 361, 'n_tokens_neox': 335, 'n_words': 143}