<commit_before>""" An abstract Table

>>> accounts = TableSymbol('accounts', '{name: string, amount: int}')
>>> deadbeats = accounts['name'][accounts['amount'] < 0]
"""
from __future__ import absolute_import, division, print_function

from abc import abstractproperty
from datashape import dshape, var, DataShape, Record, isdimension, Option
from datashape import coretypes as ct
import datashape
from toolz import concat, partial, first, compose, get, unique
from . import scalar
from .core import Expr, Scalar, path
from .scalar import ScalarSymbol
from .scalar import *
from ..compatibility import _strtypes, builtins


class TableExpr(Expr):
    """ Super class for all Table Expressions """
    __inputs__ = 'child',

    @property
    def dshape(self):
        return datashape.var * self.schema

    @property
    def columns(self):
        if isinstance(self.schema[0], Record):
            return self.schema[0].names

    @abstractproperty
    def schema(self):
        pass

    @property
    def dtype(self):
        ds = self.schema[-1]
        if isinstance(ds, Record):
            if len(ds.fields) > 1:
                raise TypeError("`.dtype` not defined for multicolumn object. "
                                "Use `.schema` instead")
            else:
                return dshape(first(ds.types))
        else:
            return dshape(ds)

    def __getitem__(self, key):
        if isinstance(key, _strtypes):
            if key not in self.columns:
                raise ValueError("Mismatched Column: %s" % str(key))
            return Column(self, key)
        if isinstance(key, list) and builtins.all(isinstance(k, _strtypes) for k in key):
            if not builtins.all(col in self.columns for col in key):
                raise ValueError("Mismatched Columns: %s" % str(key))
            return projection(self, key)
        if isinstance(key, TableExpr):
            return selection(self, key)
        raise TypeError("Did not understand input: %s[%s]" % (self, key))

    def __getattr__(self, key):
        print(type(self))
        print(key)
<commit_msg>remove debug printing code<commit_after>""" An abstract Table

>>> accounts = TableSymbol('accounts', '{name: string, amount: int}')
>>> deadbeats = accounts['name'][accounts['amount'] < 0]
"""
from __future__ import absolute_import, division, print_function

from abc import abstractproperty
from datashape import dshape, var, DataShape, Record, isdimension, Option
from datashape import coretypes as ct
import datashape
from toolz import concat, partial, first, compose, get, unique
from . import scalar
from .core import Expr, Scalar, path
from .scalar import ScalarSymbol
from .scalar import *
from ..compatibility import _strtypes, builtins


class TableExpr(Expr):
    """ Super class for all Table Expressions """
    __inputs__ = 'child',

    @property
    def dshape(self):
        return datashape.var * self.schema

    @property
    def columns(self):
        if isinstance(self.schema[0], Record):
            return self.schema[0].names

    @abstractproperty
    def schema(self):
        pass

    @property
    def dtype(self):
        ds = self.schema[-1]
        if isinstance(ds, Record):
            if len(ds.fields) > 1:
                raise TypeError("`.dtype` not defined for multicolumn object. "
                                "Use `.schema` instead")
            else:
                return dshape(first(ds.types))
        else:
            return dshape(ds)

    def __getitem__(self, key):
        if isinstance(key, _strtypes):
            if key not in self.columns:
                raise ValueError("Mismatched Column: %s" % str(key))
            return Column(self, key)
        if isinstance(key, list) and builtins.all(isinstance(k, _strtypes) for k in key):
            if not builtins.all(col in self.columns for col in key):
                raise ValueError("Mismatched Columns: %s" % str(key))
            return projection(self, key)
        if isinstance(key, TableExpr):
            return selection(self, key)
        raise TypeError("Did not understand input: %s[%s]" % (self, key))

    def __getattr__(self, key):
{'fraction_non_alphanumeric': 0.10430185051670271, 'fraction_numerical': 0.002403268445085316, 'mean_word_length': 2.5848406546080964, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '1026216', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1144, 'n_words': 381}