<commit_before>require 'sunlight/influence'
require_relative 'call_constructor_module.rb'

class Sunlight::Influence::Individual < OpenStruct
  extend CallConstructor

  ## Pass in search: "name"

  def self.ind_id_lookup(args)
    query = EntitySearch
    entity = Sunlight::Influence::find_individual(args)
    entity[0]["id"]
  end


  def self.top_individuals_by_contributions_given(options)
    if options[:cycle] != nil
      options[:parameters] = string_constructor(options)
    end
    options[:category] = "aggregates/indivs/top_#{options[:limit]}"
    options = {category: options[:category], parameters: options[:parameters]}
    bar = uri_builder(options)
    sunlight_call(bar)
  end

  def self.top_recipient_organizations(options)<commit_msg>Fix individual.rb<commit_after>require 'sunlight/influence'
require_relative 'call_constructor_module.rb'

class Sunlight::Influence::Individual < OpenStruct
  extend CallConstructor

  ## Pass in search: "name"

  def self.ind_id_lookup(args)
    entity = Sunlight::Influence::EntitySearch.find_individual(args)
    entity[0]["id"]
  end


  def self.top_individuals_by_contributions_given(options)
    if options[:cycle] != nil
      options[:parameters] = string_constructor(options)
    end
    options[:category] = "aggregates/indivs/top_#{options[:limit]}"
    options = {category: options[:category], parameters: options[:parameters]}
    bar = uri_builder(options)
    sunlight_call(bar)
  end

  def self.top_recipient_organizations(options)
{'fraction_non_alphanumeric': 0.11206896551724138, 'fraction_numerical': 0.001326259946949602, 'mean_word_length': 5.421276595744681, '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': '4211488', 'n_tokens_mistral': 483, 'n_tokens_neox': 451, 'n_words': 82}