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


class Column(object):
    creation_counter = 0

    def __init__(self, name=None):
        self._name = name

        # like django fields, keep track of the order which columns are
        # created, so they can be sorted later. (unfortunately, python
        # attrs are passed to __new__ as an unsorted dict, so we must
        # keep track of this manually to avoid random column order.)
        self.creation_counter = Column.creation_counter
        Column.creation_counter += 1


        self.bound_to = None

    def __lt__(self, other):
        """Allow columns to be sorted by order of creation."""
        return self.creation_counter < other.creation_counter

    def bind_to(self, table, name):
        if self.bound_to is not None:
            raise TypeError(
                "Column is already bound to '%s' as '%s'" %\
                    self.bound_to)

        self.bound_to = (table, name)

    @property
    def is_bound(self):
        return (self.bound_to is not None)

    @property
    def name(self):
        """Return the column name, whether explicit or implicit."""
        return self._name or self.bound_to[1]

    def render(self, value):
        """
        Return ``value`` ready for display. The default behavior is to
        simply cast it to unicode, but this may be overridden by child
        classes to do something more useful.
        """
        return unicode(value)
<commit_msg>added Column.__unicode__, for {{ column }}.<commit_after>#!/usr/bin/env python
# vim: et ts=4 sw=4


class Column(object):
    creation_counter = 0

    def __init__(self, name=None):
        self._name = name

        # like django fields, keep track of the order which columns are
        # created, so they can be sorted later. (unfortunately, python
        # attrs are passed to __new__ as an unsorted dict, so we must
        # keep track of this manually to avoid random column order.)
        self.creation_counter = Column.creation_counter
        Column.creation_counter += 1

        self.bound_to = None

    def __lt__(self, other):
        """Allow columns to be sorted by order of creation."""
        return self.creation_counter < other.creation_counter

    def __unicode__(self):
        return self.name

    def bind_to(self, table, name):
        if self.bound_to is not None:
            raise TypeError(
                "Column is already bound to '%s' as '%s'" %\
                    self.bound_to)

        self.bound_to = (table, name)

    @property
    def is_bound(self):
        return (self.bound_to is not None)

    @property
    def name(self):
        """Return the column name, whether explicit or implicit."""
        return self._name or self.bound_to[1]

    def render(self, value):
        """
        Return ``value`` ready for display. The default behavior is to
        simply cast it to unicode, but this may be overridden by child
        classes to do something more useful.
        """
        return unicode(value)

{'fraction_non_alphanumeric': 0.08497375328083989, 'fraction_numerical': 0.0032808398950131233, 'mean_word_length': 2.2332979851537647, 'pattern_counts': {'":': 0, '<': 5, '<?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': '717638', 'n_tokens_mistral': 858, 'n_tokens_neox': 808, 'n_words': 322}