<commit_before>class ColumnURL(object):
    """
    Represents the url a column's data should point to.

    :params

    url - The reversible namespace / name combination for the
            relevant view

    args - A LIST of arguments to pass (even if there's just one),
            all of which correspond to model fields

    attrs - A DICT of arguments to set as the anchor tag attributes, NOT
            including the href (of course)

    Ex:
        class MyColumnUrl(ColumnURL):
            url = 'namespace:name'
            args = ['field1', 'field2']
            attr = {'class': 'btn btn-primary'}
    """
    url = None
    args = []
    attrs = None


class Column(object):
    """
    Generic table column based off object access.  Built to work with models.

    :params

    csv_value -- Return the value to write to a csv file

    field - The field to use for this column

    header - What to display in the <th></th> tag

    accessor - How to get the data, with respect to the parent
                object.  For example, if I have a field 'created'
                and I only want to display the date, I could set
                the annotation to 'created.date'.  This is also
                where you would utilize related fields, for
                example, 'participant__full_name'

    annotation - An annotation that needs to be added to the
                queryset before the value is accessed.  This
                takes the form of a callable, so a lambda or
                function reference is appropriate here.

    default - What to display if the data is NULL.

    css_class - A class name to apply to each TD in the table.

    url_class - The ColumnURL class for the field.

    key - Not set by the user.  Basically, whatever we name the
            column in the table class.  This is used to help
            both determine the field and header if either are
            not explicitly set in the constructor.  For example,
            a column declared ``field = Column()`` will have
            a field ``field`` and a header ``Field`` as neither
            were explicitly set

    editable - Whether the column should render a field from a supplied
            formset.

    sortable - Whether or not the field should be sortable.

    sort_field - An optional field to pass that should map directly to the
            field name that the django ORM expects, if you're making use of
            some special case accessor to do rendering.
    """
    def __init__(self, field=None, header=None, accessor=None,
                 annotation=None, default=None, css_class=None,
                 url_class=None, editable=False, sortable=False,
                 sort_field=None):<commit_msg>add sortable docs for default arguments<commit_after>class ColumnURL(object):
    """
    Represents the url a column's data should point to.

    :params

    url - The reversible namespace / name combination for the
            relevant view

    args - A LIST of arguments to pass (even if there's just one),
            all of which correspond to model fields

    attrs - A DICT of arguments to set as the anchor tag attributes, NOT
            including the href (of course)

    Ex:
        class MyColumnUrl(ColumnURL):
            url = 'namespace:name'
            args = ['field1', 'field2']
            attr = {'class': 'btn btn-primary'}
    """
    url = None
    args = []
    attrs = None


class Column(object):
    """
    Generic table column based off object access.  Built to work with models.

    :params

    csv_value -- Return the value to write to a csv file

    field - The field to use for this column

    header - What to display in the <th></th> tag

    accessor - How to get the data, with respect to the parent
                object.  For example, if I have a field 'created'
                and I only want to display the date, I could set
                the annotation to 'created.date'.  This is also
                where you would utilize related fields, for
                example, 'participant__full_name'

    annotation - An annotation that needs to be added to the
                queryset before the value is accessed.  This
                takes the form of a callable, so a lambda or
                function reference is appropriate here.

    default - What to display if the data is NULL.

    css_class - A class name to apply to each TD in the table.

    url_class - The ColumnURL class for the field.

    key - Not set by the user.  Basically, whatever we name the
            column in the table class.  This is used to help
            both determine the field and header if either are
            not explicitly set in the constructor.  For example,
            a column declared ``field = Column()`` will have
            a field ``field`` and a header ``Field`` as neither
            were explicitly set

    editable - Whether the column should render a field from a supplied
            formset.

    sortable - Whether or not the field should be sortable. The lookup chain
            for the sorting field is `sort_field` -> `accessor` -> `field`,
            so a custom accessor is followed if applicable

    sort_field - An optional field to pass that should map directly to the
            field name that the django ORM expects, if you're making use of
            some special case accessor to do rendering.
    """
    def __init__(self, field=None, header=None, accessor=None,
                 annotation=None, default=None, css_class=None,
                 url_class=None, editable=False, sortable=False,
                 sort_field=None):
{'fraction_non_alphanumeric': 0.05636042402826855, 'fraction_numerical': 0.0007067137809187279, 'mean_word_length': 2.0095693779904304, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '6686855', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1347, 'n_words': 713}