<commit_before>import numpy as np

from progressivis.core.utils import (slice_to_arange, indices_len, fix_loc)

from . import Table
from . import TableSelectedView
from ..core.slot import SlotDescriptor
from .module import TableModule
from ..core.bitmap import bitmap
from .mod_impl import ModuleImpl
from .binop import ops

def _get_physical_table(t):
    return t if t.base is None else _get_physical_table(t.base)

class _Selection(object):
    def __init__(self, values=None):
        self._values = bitmap([]) if values is None else values

    def update(self, values):
        self._values.update(values)

    def remove(self, values):
        self._values = self._values -bitmap(values)

    def assign(self, values):
        self._values = values

class BisectImpl(ModuleImpl):
    def __init__(self, column, op, hist_index):
        super(BisectImpl, self).__init__()
        self._table = None
        self._column = column
        self._op = op
        if isinstance(op, str):<commit_msg>fix 4 PY2<commit_after>import numpy as np
import six
from progressivis.core.utils import (slice_to_arange, indices_len, fix_loc)

from . import Table
from . import TableSelectedView
from ..core.slot import SlotDescriptor
from .module import TableModule
from ..core.bitmap import bitmap
from .mod_impl import ModuleImpl
from .binop import ops

def _get_physical_table(t):
    return t if t.base is None else _get_physical_table(t.base)

class _Selection(object):
    def __init__(self, values=None):
        self._values = bitmap([]) if values is None else values

    def update(self, values):
        self._values.update(values)

    def remove(self, values):
        self._values = self._values -bitmap(values)

    def assign(self, values):
        self._values = values

class BisectImpl(ModuleImpl):
    def __init__(self, column, op, hist_index):
        super(BisectImpl, self).__init__()
        self._table = None
        self._column = column
        self._op = op
        if isinstance(op, six.string_types):
{'fraction_non_alphanumeric': 0.08964834076275384, 'fraction_numerical': 0.0009905894006934125, 'mean_word_length': 3.362850971922246, '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': '6589886', 'n_tokens_mistral': 604, 'n_tokens_neox': 596, 'n_words': 187}