<commit_before># ow_helper.rb
#
# AUTHOR::  <NAME>

require 'chronic_duration'

module OwHelper
  protected

  def format_time_left(time_ms)
    ChronicDuration.output(time_ms / 1000)
  end

  def footer_text
    "Retrieved from #{config.base_url}"
  end

  def ow_basic_embed(embed, title)
    embed.author = { name: title, url: config.website_url }
    embed.footer = { text: footer_text }
    embed.timestamp = Time.now
  end

  def next_match_embed(embed, match, time_to_match)
    return if match.nil?

    embed.add_field(name: 'Next Match', value: match, inline: true)
    embed.add_field(name: 'Time Until Start',
                    value: format_time_left(time_to_match), inline: true)
  end

  def live_match_embed(embed, live_match, maps)
    embed.title = 'Live Now!'
    embed.url = config.website_url
    embed.description = "***#{live_match}***"
    live_match.fill_live_embed(embed, maps)
  end

  def format_team_ranks(standings)
    str = standings.map { |rank, team| format('`%02d` %s', rank, team.name) }
                   .join("\n")
    "#{'-' * 33}\n" + str
  end

  def format_records(standings)
    str = standings.map { |_, team| "`#{team.record_str}`" }.join("\n")
    "#{'-' * 21}\n" + str
  end<commit_msg>Adding footer icon for OWL and OWC embeds<commit_after># ow_helper.rb
#
# AUTHOR::  <NAME>

require 'chronic_duration'

module OwHelper
  protected

  def format_time_left(time_ms)
    ChronicDuration.output(time_ms / 1000)
  end

  def footer_text
    "Retrieved from #{config.base_url}"
  end

  def ow_basic_embed(embed, title)
    embed.author = { name: title, url: config.website_url }
    embed.footer = { text: footer_text }
    embed.timestamp = Time.now

    embed.footer[:icon_url] = config.icon_url if config.key?(:icon_url)
  end

  def next_match_embed(embed, match, time_to_match)
    return if match.nil?

    embed.add_field(name: 'Next Match', value: match, inline: true)
    embed.add_field(name: 'Time Until Start',
                    value: format_time_left(time_to_match), inline: true)
  end

  def live_match_embed(embed, live_match, maps)
    embed.title = 'Live Now!'
    embed.url = config.website_url
    embed.description = "***#{live_match}***"
    live_match.fill_live_embed(embed, maps)
  end

  def format_team_ranks(standings)
    str = standings.map { |rank, team| format('`%02d` %s', rank, team.name) }
                   .join("\n")
    "#{'-' * 33}\n" + str
  end

  def format_records(standings)
    str = standings.map { |_, team| "`#{team.record_str}`" }.join("\n")
    "#{'-' * 21}\n" + str
  end
{'fraction_non_alphanumeric': 0.1378640776699029, 'fraction_numerical': 0.007766990291262136, 'mean_word_length': 3.2578512396694217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4858515', 'n_tokens_mistral': 958, 'n_tokens_neox': 906, 'n_words': 200}