<commit_before>#!/usr/bin/env python
# vim: set sts=4 sw=4 et:

import logging
import xmlrpc
from optparse import OptionParser
from players import CountingBotPlayer, DummyBotPlayer
from game import GameController

def _run_remote(server_addr):
    """
    Run, Forrest! Run!
    """
    if not server_addr.startswith('http://'):
        server_addr = 'http://' + server_addr

    game = xmlrpc.XMLRPCProxyController(server_addr)
    player = xmlrpc.XMLRPCCliPlayer('Humaani')
    game.register_player(player)
    player.start()
    game.start_game_with_bots()
    
def _run_local():
    """
    Run, Forrest! Run!
    """
    format = "%(message)s"
    logging.basicConfig(level=logging.DEBUG, format=format)
    game = GameController()

    #game.register_player(CliPlayer('Ihminen'))
    for i in range(0, 4):
        if i % 2 == 0:
            game.register_player(CountingBotPlayer('Lopotti %d' % i))
        else:
            game.register_player(DummyBotPlayer('Robotti %d' % i))

    game.start_game()
    game.wait_for_shutdown()
       
def _main():<commit_msg>enable human client in local mode<commit_after>#!/usr/bin/env python
# vim: set sts=4 sw=4 et:

import logging
import xmlrpc
from optparse import OptionParser
from players import CliPlayer, CountingBotPlayer, DummyBotPlayer
from game import GameController

def _run_remote(server_addr):
    """
    Run, Forrest! Run!
    """
    if not server_addr.startswith('http://'):
        server_addr = 'http://' + server_addr

    game = xmlrpc.XMLRPCProxyController(server_addr)
    player = xmlrpc.XMLRPCCliPlayer('Humaani')
    game.register_player(player)
    player.start()
    game.start_game_with_bots()
    
def _run_local():
    """
    Run, Forrest! Run!
    """
    format = "%(message)s"
    logging.basicConfig(level=logging.DEBUG, format=format)
    game = GameController()

    game.register_player(CliPlayer('Ihminen'))
    for i in range(0, 3):
        if i % 2 == 0:
            game.register_player(CountingBotPlayer('Lopotti %d' % i))
        else:
            game.register_player(DummyBotPlayer('Robotti %d' % i))

    game.start_game()
    game.wait_for_shutdown()
       
def _main():
{'fraction_non_alphanumeric': 0.12258064516129032, 'fraction_numerical': 0.005529953917050691, 'mean_word_length': 3.282051282051282, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '2160257', 'n_tokens_mistral': 727, 'n_tokens_neox': 705, 'n_words': 153}