<commit_before>class HelpdeskTicketSerializer < ActiveModel::Serializer
  attributes :id,
             :student,
             :task,
             :tutorial,
             :target_grade,
             :description,
             :is_resolved,
             :created_at,
             :resolved_at,
             :minutes_to_resolve

  has_one :task, serializer: ShallowTaskSerializer

  def project_id
    object.project.id
  end

  def student
    ShallowUserSerializer.new object.student
  end

  def tutorial
    TutorialSerializer.new object.project.tutorial
  end

  def target_grade
    object.project.target_grade
  end
end

class ShallowHelpdeskTicketSerializer < ActiveModel::Serializer
  attributes :id,
             :project_id,
             :task_definition_id,
             :description,
             :is_resolved,
             :created_at,
             :resolved_at,
             :minutes_to_resolve

  def task_definition_id
    task = object.task
    task.task_definition_id if task
  end
end<commit_msg>QUALITY: Add missing is_closed field to ticket serialiser<commit_after>class HelpdeskTicketSerializer < ActiveModel::Serializer
  attributes :id,
             :student,
             :task,
             :tutorial,
             :target_grade,
             :description,
             :is_resolved,
             :is_closed,
             :created_at,
             :resolved_at,
             :minutes_to_resolve

  has_one :task, serializer: ShallowTaskSerializer

  def project_id
    object.project.id
  end

  def student
    ShallowUserSerializer.new object.student
  end

  def tutorial
    TutorialSerializer.new object.project.tutorial
  end

  def target_grade
    object.project.target_grade
  end
end

class ShallowHelpdeskTicketSerializer < ActiveModel::Serializer
  attributes :id,
             :project_id,
             :task_definition_id,
             :description,
             :is_resolved,
             :is_closed,
             :created_at,
             :resolved_at,
             :minutes_to_resolve

  def task_definition_id
    task = object.task
    task.task_definition_id if task
  end
end
{'fraction_non_alphanumeric': 0.05707547169811321, 'fraction_numerical': 0.0, 'mean_word_length': 1.9957627118644068, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2970196', 'n_tokens_mistral': 598, 'n_tokens_neox': 576, 'n_words': 124}