<commit_before>module Concerns::UserImagesConcern
  extend ActiveSupport::Concern

  included do
    # Default image sizes are the same as Twitter's.
    # https://dev.twitter.com/docs/user-profile-images-and-banners
    # Modify provider specific image methods as needed after changing IMAGE_SIZES.
    IMAGE_SIZES = {
      tiny:   24,
      thumb:  48,
      large:  73
    }.freeze
  end

  # ssl: true|false
  # size: :tiny|:thumb|:large
  def image_url(*opts)
    sized_image_url(self[:image_url], *opts) || gravatar_url(*opts)
  end

  def sized_image_url(url, size: :thumb, ssl: true)
    return nil unless url.present?
    type = image_url_type(url)
    return url if type == :url
    self.send("sized_#{type}_image_url", url, size: size, ssl: ssl)<commit_msg>Check for defined constant to suppress warnings<commit_after>module Concerns::UserImagesConcern
  extend ActiveSupport::Concern

  included do
    # Default image sizes are the same as Twitter's.
    # https://dev.twitter.com/docs/user-profile-images-and-banners
    # Modify provider specific image methods as needed after changing IMAGE_SIZES.
    unless defined? IMAGE_SIZES
      IMAGE_SIZES = {
        tiny:   24,
        thumb:  48,
        large:  73
      }.freeze
    end
  end

  # ssl: true|false
  # size: :tiny|:thumb|:large
  def image_url(*opts)
    sized_image_url(self[:image_url], *opts) || gravatar_url(*opts)
  end

  def sized_image_url(url, size: :thumb, ssl: true)
    return nil unless url.present?
    type = image_url_type(url)
    return url if type == :url
    self.send("sized_#{type}_image_url", url, size: size, ssl: ssl)
{'fraction_non_alphanumeric': 0.10665844636251541, 'fraction_numerical': 0.007398273736128237, 'mean_word_length': 3.351206434316354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5551981', 'n_tokens_mistral': 567, 'n_tokens_neox': 539, 'n_words': 143}