<commit_before>require 'active_record'
require 'yaml'
require 'logger'

ActiveRecord::Base.configurations = YAML.load_file('database.yml')
ActiveRecord::Base.establish_connection(:development)

class ClawlGithubRepository < ActiveRecord::Base
  LOG = Logger.new(STDOUT)

  def self.register(json, lang, user_json, i)
    ct = ClawlGithubRepository.where(github_id: json['id'], language: lang).take
    if ct.nil?
      create(json, lang, user_json, i)
    else
      update(ct, json, lang, user_json, i)
    end
  end

  private
  def self.reate(json, lang, user_json, i)
    ClawlGithubRepository.create(<commit_msg>Fix compile error<commit_after>require 'active_record'
require 'yaml'
require 'logger'

ActiveRecord::Base.configurations = YAML.load_file('database.yml')
ActiveRecord::Base.establish_connection(:development)

class ClawlGithubRepository < ActiveRecord::Base
  LOG = Logger.new(STDOUT)

  def self.register(json, lang, user_json, i)
    ct = ClawlGithubRepository.where(github_id: json['id'], language: lang).take
    if ct.nil?
      create(json, lang, user_json, i)
    else
      update(ct, json, lang, user_json, i)
    end
  end

  private
  def self.create(json, lang, user_json, i)
    ClawlGithubRepository.create(
{'fraction_non_alphanumeric': 0.11460855528652139, 'fraction_numerical': 0.0, 'mean_word_length': 4.821596244131455, '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': '4752149', 'n_tokens_mistral': 425, 'n_tokens_neox': 405, 'n_words': 91}