<commit_before>class ImageSerializer < ActiveModel::Serializer
  include Skylight::Helpers
  attributes :id, :device_id, :attachment_processed_at, :updated_at,
             :created_at, :attachment_url, :meta

  instrument_method
  def attachment_url
    object.attachment.url("x640")
  end
end<commit_msg>Force GCS-based setups to server images over HTTPS<commit_after>class ImageSerializer < ActiveModel::Serializer
  include Skylight::Helpers
  attributes :id, :device_id, :attachment_processed_at, :updated_at,
             :created_at, :attachment_url, :meta

  instrument_method
  def attachment_url
    url_ = object.attachment.url("x640")
    # Force google cloud users to use HTTPS://
    if Api::ImagesController::KEY.present?
      return url_.gsub("http://", "https://")
    else
      return url_
    end
  end
end
{'fraction_non_alphanumeric': 0.09673518742442563, 'fraction_numerical': 0.007255139056831923, 'mean_word_length': 4.111111111111111, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '6066074', 'n_tokens_mistral': 250, 'n_tokens_neox': 246, 'n_words': 61}