<commit_before>from utils import *

import models
import settings

class Thread(models.Model):

    accessible_fields = [
        'id', 'title', 'body', 'anonymous', 'anonymous_to_peers', 'course_id',
        'closed', 'tags', 'votes', 'commentable_id', 'username', 'user_id',
        'created_at', 'updated_at', 'comments_count', 'at_position_list',
        'children', 'type', 'highlighted_title', 'highlighted_body', 'endorsed'
    ]

    updatable_fields = [
        'title', 'body', 'anonymous', 'anonymous_to_peers', 'course_id',
        'closed', 'tags', 'user_id', 'commentable_id',
    ]

    initializable_fields = updatable_fields

    base_url = "{prefix}/threads".format(prefix=settings.PREFIX)
    default_retrieve_params = {'recursive': False}
    type = 'thread'

    @classmethod
    def search(cls, query_params, *args, **kwargs):
        default_params = {'page': 1,
                          'per_page': 20,
                          'course_id': query_params['course_id'],
                          'recursive': False}
        params = merge_dict(default_params, strip_blank(strip_none(query_params)))
        if query_params.get('text') or query_params.get('tags') or query_params.get('commentable_ids'):
            url = cls.url(action='search')<commit_msg>Prepare lms for upcoming discussion service changes.<commit_after>from utils import *

import models
import settings

class Thread(models.Model):

    accessible_fields = [
        'id', 'title', 'body', 'anonymous', 'anonymous_to_peers', 'course_id',
        'closed', 'tags', 'votes', 'commentable_id', 'username', 'user_id',
        'created_at', 'updated_at', 'comments_count', 'unread_comments_count',
        'at_position_list', 'children', 'type', 'highlighted_title',
        'highlighted_body', 'endorsed', 'unread'
    ]

    updatable_fields = [
        'title', 'body', 'anonymous', 'anonymous_to_peers', 'course_id',
        'closed', 'tags', 'user_id', 'commentable_id',
    ]

    initializable_fields = updatable_fields

    base_url = "{prefix}/threads".format(prefix=settings.PREFIX)
    default_retrieve_params = {'recursive': False}
    type = 'thread'

    @classmethod
    def search(cls, query_params, *args, **kwargs):
        default_params = {'page': 1,
                          'per_page': 20,
                          'course_id': query_params['course_id'],
                          'recursive': False}
        params = merge_dict(default_params, strip_blank(strip_none(query_params)))
        if query_params.get('text') or query_params.get('tags') or query_params.get('commentable_ids'):
            url = cls.url(action='search')
{'fraction_non_alphanumeric': 0.14409984871406958, 'fraction_numerical': 0.0022692889561270802, 'mean_word_length': 3.1984126984126986, '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': '4916620', 'n_tokens_mistral': 823, 'n_tokens_neox': 800, 'n_words': 159}