<commit_before>#!venv/bin/python2.7

# Python backend for go-lite-bot, the small Go bot

# Import the Updater class from the nice telegram API wrapper
from telegram.ext import Updater

# Our game-board abstraction
from goboard import Node, Empty, Board

# From the muiltipart business
import httplib
import mimetypes
import urlparse
import uuid

# So we can draw the board
from PIL import Image, ImageDraw, ImageFont
import StringIO

# So we can save the board
import os.path
import os.mkdir
import pickle

# So we can pick random colors
import random 

# Double-ended queue for the flooding mechanism
from collections import deque

# Create our Updater
# For ease of configuration, we pull our token from a text file located in the same directory
f = open('token.txt', 'r')
token = f.readline().strip()
f.close()
updater = Updater(token = token)

# Convenience for the dispatcher?
dispatcher = updater.dispatcher

# Size of the board
board_size = 9

# Image dimensions
image_dim = 1050

# Name of the save file
saved_board = 'saved_board.p'

# Directory for save files
save_dir = 'games/'
# If it already exists, just silently fails
os.mkdir(save_dir)

# Represents the game state, which can be loaded from a file
def get_board(filename):
    if os.path.isfile(filename):
        f = open(save_dir + filename, 'r')
        out = pickle.load(f)<commit_msg>Fixed method invocation<commit_after>#!venv/bin/python2.7

# Python backend for go-lite-bot, the small Go bot

# Import the Updater class from the nice telegram API wrapper
from telegram.ext import Updater

# Our game-board abstraction
from goboard import Node, Empty, Board

# From the muiltipart business
import httplib
import mimetypes
import urlparse
import uuid

# So we can draw the board
from PIL import Image, ImageDraw, ImageFont
import StringIO

# So we can save the board
import os.path
from os import mkdir
import pickle

# So we can pick random colors
import random 

# Double-ended queue for the flooding mechanism
from collections import deque

# Create our Updater
# For ease of configuration, we pull our token from a text file located in the same directory
f = open('token.txt', 'r')
token = f.readline().strip()
f.close()
updater = Updater(token = token)

# Convenience for the dispatcher?
dispatcher = updater.dispatcher

# Size of the board
board_size = 9

# Image dimensions
image_dim = 1050

# Name of the save file
saved_board = 'saved_board.p'

# Directory for save files
save_dir = 'games/'
# If it already exists, just silently fails
mkdir(save_dir)

# Represents the game state, which can be loaded from a file
def get_board(filename):
    if os.path.isfile(filename):
        f = open(save_dir + filename, 'r')
        out = pickle.load(f)
{'fraction_non_alphanumeric': 0.07121879588839941, 'fraction_numerical': 0.005139500734214391, 'mean_word_length': 4.210325047801147, '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': '4175319', 'n_tokens_mistral': 842, 'n_tokens_neox': 824, 'n_words': 353}