<commit_before>class Event < ApplicationRecord
  validates :name, presence: true
  validates :lat, presence: true
  validates :lon, presence: true
  validates :location_name, presence: true
  validates :description, presence: true
  validates :starts_at, presence: true

  scope :upcoming, ->{ where("starts_at >= ?", Time.now).order("starts_at ASC") }

  has_many :user_events, dependent: :destroy
  has_many :users, through: :user_events

  def city_name
    location_name.match(/\w+,? (?=AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|MP|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY)[A-Z]{2}/)[0]
  end

  def related_events
    if name.downcase.include? "women"
      Event.where("name ILIKE '%women%' OR name ILIKE '%woman%'")
    else
      Event.where("name NOT ILIKE '%women%' AND name NOT ILIKE '%woman%'")
    end
  end
end
<commit_msg>Exclude self from related events<commit_after>class Event < ApplicationRecord
  validates :name, presence: true
  validates :lat, presence: true
  validates :lon, presence: true
  validates :location_name, presence: true
  validates :description, presence: true
  validates :starts_at, presence: true

  scope :upcoming, ->{ where("starts_at >= ?", Time.now).order("starts_at ASC") }

  has_many :user_events, dependent: :destroy
  has_many :users, through: :user_events

  def city_name
    location_name.match(/\w+,? (?=AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|MP|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY)[A-Z]{2}/)[0]
  end

  def related_events
    if name.downcase.include? "women"
      Event.where("name ILIKE '%women%' OR name ILIKE '%woman%'").where.not(id: id)
    else
      Event.where("name NOT ILIKE '%women%' AND name NOT ILIKE '%woman%'").where.not(id: id)
    end
  end
end

{'fraction_non_alphanumeric': 0.17163788592360021, 'fraction_numerical': 0.0020931449502878076, 'mean_word_length': 5.352159468438538, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6675280', 'n_tokens_mistral': 800, 'n_tokens_neox': 765, 'n_words': 146}