IMPORTANT: Call this function at the beginning of your program.

def initialize():
    """IMPORTANT: Call this function at the beginning of your program."""
    try:
        requests.get('http://localhost:4242/poll')
        state['connected_to_bot'] = True
    except requests.exceptions.ConnectionError:
        state['connected_to_bot'] = False

    # set up turtle
    state['window'] = turtle.Screen()
    state['window'].setup(width=AXI_WIDTH, height=AXI_HEIGHT)
    state['turtle'] = turtle.Turtle()
    state['turtle'].width(2)
    state['turtle'].speed(0)
    point_in_direction(0)

    pen_up()