<commit_before># -*- coding: utf-8 -*-

from __future__ import unicode_literals
from suit_dashboard.box import Box


class Grid(object):
    def __init__(self, *rows, **kwargs):
        if not all([isinstance(r, Row) for r in rows]):
            raise TypeError('All elements of Grid must be Row instances')
        self.type = 'grid'
        self.rows = rows


class Row(object):
    def __init__(self, *columns, **kwargs):
        if not all([isinstance(c, Column) for c in columns]):
            raise TypeError('All elements of Row must be Column instances')
        self.type = 'row'
        self.columns = columns


class Column(object):
    def __init__(self, *elements, **kwargs):
        if not all([isinstance(e, Column) or issubclass(type(e), Box)
                    for e in elements]):
            raise TypeError('All elements of Column must '
                            'be Row or Box instances')
        width = kwargs.pop('width', 12)
        if width not in range(1, 13):
            raise ValueError('Column width must be between 1 and 12')

        self.type = 'column'
        self.elements = elements
        self.width = width<commit_msg>Fix type check of column elements<commit_after># -*- coding: utf-8 -*-

from __future__ import unicode_literals
from suit_dashboard.box import Box


class Grid(object):
    def __init__(self, *rows, **kwargs):
        if not all([isinstance(r, Row) for r in rows]):
            raise TypeError('All elements of Grid must be Row instances')
        self.type = 'grid'
        self.rows = rows


class Row(object):
    def __init__(self, *columns, **kwargs):
        if not all([isinstance(c, Column) for c in columns]):
            raise TypeError('All elements of Row must be Column instances')
        self.type = 'row'
        self.columns = columns


class Column(object):
    def __init__(self, *elements, **kwargs):
        if not all([isinstance(e, Row) or issubclass(type(e), Box)
                    for e in elements]):
            raise TypeError('All elements of Column must '
                            'be Row or Box instances')
        width = kwargs.pop('width', 12)
        if width not in range(1, 13):
            raise ValueError('Column width must be between 1 and 12')

        self.type = 'column'
        self.elements = elements
        self.width = width
{'fraction_non_alphanumeric': 0.10584720443875373, 'fraction_numerical': 0.0076824583866837385, 'mean_word_length': 2.292134831460674, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6247568', 'n_tokens_mistral': 660, 'n_tokens_neox': 633, 'n_words': 238}