<commit_before>class Relation < ActiveRecord::Base

  def self.add_raw(name, id_from, id_to)
    hsh = { name: name, x_id: id_from, y_id: id_to }
    Relation.create!(hsh)  if Relation.where(hsh).first == nil
  end

  def self.delete_raw(name, id_from, id_to)
    hsh = { name: name, x_id: id_from, y_id: id_to }
    Relation.where(hsh).delete_all
  end

  def self.references_raw(name, id_from)
    ids = self.referenced_ids_raw(name, id_from)
  end

  def self.followers_raw(name, id_to)
    ids = self.followers_ids_raw(name, id_to)
  end


 private
  def self.referenced_ids_raw(name, id_from)
    Relation.where(name: name, x_id: id_from).pluck(:y_id)
  end

  def self.followers_ids_raw(name, id_to)
    Relation.where(name: name, y_id: id_to).pluck(:x_id)
  end

end<commit_msg>'cleaning'<commit_after>class Relation < ActiveRecord::Base

  def self.add_raw(name, id_from, id_to)
    hsh = { name: name, x_id: id_from, y_id: id_to }
    Relation.create!(hsh)  if Relation.where(hsh).first == nil
  end

  def self.delete_raw(name, id_from, id_to)
    hsh = { name: name, x_id: id_from, y_id: id_to }
    Relation.where(hsh).delete_all
  end

  def self.references_raw(name, id_from)
    Relation.where(name: name, x_id: id_from).pluck(:y_id)
  end

  def self.followers_raw(name, id_to)
    Relation.where(name: name, y_id: id_to).pluck(:x_id)
  end

end
{'fraction_non_alphanumeric': 0.12343864805290228, 'fraction_numerical': 0.0, 'mean_word_length': 4.007352941176471, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5965345', 'n_tokens_mistral': 578, 'n_tokens_neox': 566, 'n_words': 112}