<commit_before>"""
A TurtleProcess is a subclass of ``multiprocessing.Process``.
It is the process from which the user of PythonTurtle works.
"""
import copy
import math
import multiprocessing
import sys
import time

from . import shelltoprocess
from .misc import smartsleep
from .misc.helpers import deg_to_rad  # , log
from .misc.vector import Vector
from .my_turtle import Turtle, from_my_angle


class TurtleProcess(multiprocessing.Process):
    """
    Defines all the turtle commands (i.e. go, turn, width, etc.),
    then runs a ``shelltoprocess.Console`` which connects to the shell
    in the main application window, allowing the user to control this
    process.
    """

    def __init__(self, *args, **kwargs):
        multiprocessing.Process.__init__(self, *args, **kwargs)

        self.daemon = True

        self.turtle_queue = multiprocessing.Queue()
        self.queue_pack = shelltoprocess.make_queue_pack()

        #
        # constants:
        #
        self.FPS = 25
        self.FRAME_TIME = 1 / float(self.FPS)

    def send_report(self):
        """
        Sends a "turtle report" to the TurtleWidget.
        By sending turtle reports every time the turtle does anything,
        the TurtleWidget can always know where the turtle is going
        and draw graphics accordingly.
        """
        # self.turtle.fingerprint = random.randint(0,10000)
        self.turtle_queue.put(self.turtle)
        # log(self.turtle.__dict__)

    def run(self):

        self.turtle = Turtle()

        def go(distance):
            """
            Makes the turtle walk the specified distance. Use a negative number<commit_msg>Block help, license and exit from shell. Fix #113<commit_after>"""
A TurtleProcess is a subclass of ``multiprocessing.Process``.
It is the process from which the user of PythonTurtle works.
"""
import copy
import math
import multiprocessing
import sys
import time
import builtins

from . import shelltoprocess
from .misc import smartsleep
from .misc.helpers import deg_to_rad  # , log
from .misc.vector import Vector
from .my_turtle import Turtle, from_my_angle


class TurtleProcess(multiprocessing.Process):
    """
    Defines all the turtle commands (i.e. go, turn, width, etc.),
    then runs a ``shelltoprocess.Console`` which connects to the shell
    in the main application window, allowing the user to control this
    process.
    """

    def __init__(self, *args, **kwargs):
        multiprocessing.Process.__init__(self, *args, **kwargs)

        self.daemon = True

        self.turtle_queue = multiprocessing.Queue()
        self.queue_pack = shelltoprocess.make_queue_pack()

        #
        # constants:
        #
        self.FPS = 25
        self.FRAME_TIME = 1 / float(self.FPS)

    def send_report(self):
        """
        Sends a "turtle report" to the TurtleWidget.
        By sending turtle reports every time the turtle does anything,
        the TurtleWidget can always know where the turtle is going
        and draw graphics accordingly.
        """
        # self.turtle.fingerprint = random.randint(0,10000)
        self.turtle_queue.put(self.turtle)
        # log(self.turtle.__dict__)

    def run(self):
        
        builtins.help = builtins.license = builtins.exit = \
                                lambda *args,  **kwargs: print('Not supported')
        
        self.turtle = Turtle()

        def go(distance):
            """
            Makes the turtle walk the specified distance. Use a negative number
{'fraction_non_alphanumeric': 0.08485714285714285, 'fraction_numerical': 0.006, 'mean_word_length': 2.565173116089613, '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': '5260544', 'n_tokens_mistral': 1074, 'n_tokens_neox': 977, 'n_words': 329}