<commit_before># Datei: chaosplotter.py
# Autor: <NAME>
# Datum: 31. 5. 2008

# Ein einfaches Programm zur Demonstration von "chaotischem Verhalten".

from turtle import *

def f(x):
    return 3.9*x*(1-x)

def g(x):
    return 3.9*(x-x**2)

def h(x):
    return 3.9*x-3.9*x*x

def coosys():
    penup()
    goto(-1,0)
    pendown()
    goto(n+1,0)
    penup()
    goto(0, -0.1)
    pendown()
    goto(-0.1, 1.1)

def plot(fun, start, farbe):
    x = start
    pencolor(farbe)
    penup()
    goto(0, x)
    pendown()
    dot(5)
    for i in range(n):
        x=fun(x)
        goto(i+1,x)
        dot(5)

def main():
    global n
    n = 80
    ox=-250.0
    oy=-150.0
    ex= -2.0*ox / n
    ey=300.0

    reset()
    setworldcoordinates(-1.0,-0.1, n+1, 1.1)
    speed(0)
    hideturtle()
    coosys()
    plot(f, 0.35, "blue")
    plot(g, 0.35, "green")
    plot(h, 0.35, "red")
    for s in range(100):
        setworldcoordinates(0.5*s,-0.1, n+1, 1.1)

    return "Done!"

if __name__ == "__main__":
    main()
    mainloop()<commit_msg>Issue 6340: update by <NAME> of his tdemo_chaos demo program. Functionally equivalent, clearer code, English comments.<commit_after># File: tdemo_chaos.py
# Author: <NAME>
# Date: 2009-06-24

# A demonstration of chaos

from turtle import *

N = 80

def f(x):
    return 3.9*x*(1-x)

def g(x):
    return 3.9*(x-x**2)

def h(x):
    return 3.9*x-3.9*x*x

def jumpto(x, y):
    penup(); goto(x,y)

def line(x1, y1, x2, y2):
    jumpto(x1, y1)
    pendown()
    goto(x2, y2)

def coosys():
    line(-1, 0, N+1, 0)
    line(0, -0.1, 0, 1.1)

def plot(fun, start, colour):
    pencolor(colour)
    x = start
    jumpto(0, x)
    pendown()
    dot(5)
    for i in range(N):
        x=fun(x)
        goto(i+1,x)
        dot(5)

def main():
    reset()
    setworldcoordinates(-1.0,-0.1, N+1, 1.1)
    speed(0)
    hideturtle()
    coosys()
    plot(f, 0.35, "blue")
    plot(g, 0.35, "green")
    plot(h, 0.35, "red")
    # Now zoom in:
    for s in range(100):
        setworldcoordinates(0.5*s,-0.1, N+1, 1.1)
    return "Done!"

if __name__ == "__main__":
    main()
    mainloop()
{'fraction_non_alphanumeric': 0.1798017932987258, 'fraction_numerical': 0.06984426616328457, 'mean_word_length': 2.2665639445300463, 'pattern_counts': {'":': 2, '<': 6, '<?xml version=': 0, '>': 6, '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': '6406569', 'n_tokens_mistral': 1027, 'n_tokens_neox': 951, 'n_words': 225}