<commit_before>"""
Simple animation for your shell
"""
from field import Field
import time
import random

class Ball():
    def __init__(self, image=random.choice(["o", "O", "@", "( )"]), x=1, y=1):
        self.image = image
        self.x = x
        self.y = y
        self.dx = 1
        self.dy = 1
        return

    def move(self):
        self.x += self.dx
        self.y += self.dy
        return

    def bounce(self, direction):
        if 'up' in direction or 'down' in direction:
            self.dy *= -1
        if 'right' in direction or 'left' in direction:
            self.dx *= -1
        return

    def getVelocity(self):
        return (self.dx, self.dy)

    def velocity(self, dx, dy):
        self.dx, self.dy = dx, dy
        return

    def getPosition(self):
        return (self.y, self.x)

    def position(self, x, y):
        self.x, self.y = x, y
        return
    
    def walled(self, ball):
        direction = []
        if ball.x < 1:
            direction.append('right')
        elif ball.x >= self.field.x-1:
            direction.append('left')

        if ball.y < 1:
            direction.append('down')
        elif ball.y >= self.field.y-1:
            direction.append('up')

        if len(direction):
            return ' '.join(direction)
        return None

class Saver():
    def __init__(self, balls=int(random.random() * 100), trail=" "):
        self.field = Field()
        self.balls = [Ball(x=int(random.random() * self.field.x-1)+1, y=int(random.random() * self.field.y-1)+1) for x in range(balls)]
        self.speed = 0.009
        self.trail = trail
        return

    def update(self):
        for ball in self.balls:
            hitWall = self.walled(ball)

            if hitWall: # wall collision
                ball.bounce(hitWall)

            # ball collision

            self.clearTrail(ball, self.trail, True)
            ball.move()

            self.field.addItem(ball.image, ball.getPosition())

        # clear the field randomly (.1% chance)
        if random.choice(range(1000)) == 1:
            self.field.clearField()
        self.field.deploy()<commit_msg>added title<commit_after>"""
Simple animation for your shell
"""
from field import Field
import time
import random

class Ball():
    def __init__(self, image=random.choice(["o", "O", "@", "( )"]), x=1, y=1):
        self.image = image
        self.x = x
        self.y = y
        self.dx = 1
        self.dy = 1
        return

    def move(self):
        self.x += self.dx
        self.y += self.dy
        return

    def bounce(self, direction):
        if 'up' in direction or 'down' in direction:
            self.dy *= -1
        if 'right' in direction or 'left' in direction:
            self.dx *= -1
        return

    def getVelocity(self):
        return (self.dx, self.dy)

    def velocity(self, dx, dy):
        self.dx, self.dy = dx, dy
        return

    def getPosition(self):
        return (self.y, self.x)

    def position(self, x, y):
        self.x, self.y = x, y
        return

    def walled(self, ball):
        direction = []
        if ball.x < 1:
            direction.append('right')
        elif ball.x >= self.field.x-1:
            direction.append('left')

        if ball.y < 1:
            direction.append('down')
        elif ball.y >= self.field.y-1:
            direction.append('up')

        if len(direction):
            return ' '.join(direction)
        return None

class Saver():
    def __init__(self, balls=int(random.random() * 100), trail=" "):
        self.field = Field(title="Term Saver")
        self.balls = [Ball(x=int(random.random() * self.field.x-1)+1, y=int(random.random() * self.field.y-1)+1) for x in range(balls)]
        self.speed = 0.009
        self.trail = trail
        return

    def update(self):
        for ball in self.balls:
            hitWall = self.walled(ball)

            if hitWall: # wall collision
                ball.bounce(hitWall)

            # ball collision

            self.clearTrail(ball, self.trail, True)
            ball.move()

            self.field.addItem(ball.image, ball.getPosition())

        # clear the field randomly (.1% chance)
        if random.choice(range(1000)) == 1:
            self.field.clearField()
        self.field.deploy()
{'fraction_non_alphanumeric': 0.13372093023255813, 'fraction_numerical': 0.012558139534883722, 'mean_word_length': 1.7204301075268817, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3556561', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1303, 'n_words': 347}