<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .koma import Koma
from .pieces_act import KOMA_INFOS


class Grid:
    '''Grid class

    Args
    -------------------
    which_player : optional (default = None)
    csa_piece : optional (default = None)
    '''
    def __init__(self, which_player=None, csa_piece=None):

        if which_player in [None, '+', '-']:
            self.which_player = which_player
        else:
            raise RuntimeError('Invalid which_player:', which_player)

        if csa_piece:
            self.koma = Koma(csa_piece)
        else:
            self.koma = None

    def __str__(self):
        if self.which_player and self.koma:
            return self.which_player + self.koma.csa
        else:
            return '   '
                
    def is_empty(self):
        return self.which_player is None
           
    def is_of_sente(self):
        return self.which_player == '+'

    def reset(self):
        self.which_player = None
        self.koma = None<commit_msg>Apply autopep8 to grid.py<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .koma import Koma
from .pieces_act import KOMA_INFOS


class Grid:

    '''Grid class

    Args
    -------------------
    which_player : optional (default = None)
    csa_piece : optional (default = None)
    '''

    def __init__(self, which_player=None, csa_piece=None):

        if which_player in [None, '+', '-']:
            self.which_player = which_player
        else:
            raise RuntimeError('Invalid which_player:', which_player)

        if csa_piece:
            self.koma = Koma(csa_piece)
        else:
            self.koma = None

    def __str__(self):
        if self.which_player and self.koma:
            return self.which_player + self.koma.csa
        else:
            return '   '

    def is_empty(self):
        return self.which_player is None

    def is_of_sente(self):
        return self.which_player == '+'

    def reset(self):
        self.which_player = None
        self.koma = None
{'fraction_non_alphanumeric': 0.11836337067705796, 'fraction_numerical': 0.0014612761811982464, 'mean_word_length': 1.8448753462603877, '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': '860839', 'n_tokens_mistral': 651, 'n_tokens_neox': 624, 'n_words': 150}