<commit_before>class SubjectSerializer
  include RestPack::Serializer
  include FilterHasMany

  attributes :id, :metadata, :locations, :zooniverse_id,
    :created_at, :updated_at, :href

  optional :retired, :already_seen

  can_include :project, :collections

  def locations

    @model.locations.order("\"media\".\"metadata\"->>'index' ASC").map do |loc|
      {
       loc.content_type => loc.url_for_format(@context[:url_format] || :get)
      }
    end
  end

  def retired
    @model.retired_for_workflow?(workflow)
  end

  def already_seen
    !!(user_seen && user_seen.subject_ids.include?(@model.id))
  end

  private

  def include_retired?<commit_msg>Remove blank line at start of method body<commit_after>class SubjectSerializer
  include RestPack::Serializer
  include FilterHasMany

  attributes :id, :metadata, :locations, :zooniverse_id,
    :created_at, :updated_at, :href

  optional :retired, :already_seen

  can_include :project, :collections

  def locations
    @model.locations.order("\"media\".\"metadata\"->>'index' ASC").map do |loc|
      {
       loc.content_type => loc.url_for_format(@context[:url_format] || :get)
      }
    end
  end

  def retired
    @model.retired_for_workflow?(workflow)
  end

  def already_seen
    !!(user_seen && user_seen.subject_ids.include?(@model.id))
  end

  private

  def include_retired?
{'fraction_non_alphanumeric': 0.12067696835908756, 'fraction_numerical': 0.0, 'mean_word_length': 3.8745519713261647, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5985029', 'n_tokens_mistral': 461, 'n_tokens_neox': 437, 'n_words': 92}