<commit_before>class Api::Scenario < ActiveResource::Base
  PRESET_GROUPS = [
    'Actueel',
    'High Energy Productivity Growth',
    'Watt Nu?! 2013',
    'Watt Nu?! 2012',
    'EC2013',
    'Regional',
    :rest,
    nil
  ].freeze

  self.site = "#{APP_CONFIG[:api_url]}/api/v3"

  def self.url_to(path)
    "#{ APP_CONFIG[:api_url] }/api/v3/scenarios/#{ path }"
  end

  def self.batch_load(ids)
    HTTParty.get(url_to("#{ ids.uniq.join(',') }/batch")).map { |scn| new(scn) }
  end

  def self.find_with_queries(id, queries)<commit_msg>Api::Scenario.batch_load ignores empty array of IDs<commit_after>class Api::Scenario < ActiveResource::Base
  PRESET_GROUPS = [
    'Actueel',
    'High Energy Productivity Growth',
    'Watt Nu?! 2013',
    'Watt Nu?! 2012',
    'EC2013',
    'Regional',
    :rest,
    nil
  ].freeze

  self.site = "#{APP_CONFIG[:api_url]}/api/v3"

  def self.url_to(path)
    "#{ APP_CONFIG[:api_url] }/api/v3/scenarios/#{ path }"
  end

  def self.batch_load(ids)
    return [] if ids.empty?

    HTTParty.get(url_to("#{ ids.uniq.join(',') }/batch")).map { |scn| new(scn) }
  end

  def self.find_with_queries(id, queries)
{'fraction_non_alphanumeric': 0.17606244579358196, 'fraction_numerical': 0.024284475281873375, 'mean_word_length': 3.421455938697318, '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': '4301614', 'n_tokens_mistral': 495, 'n_tokens_neox': 462, 'n_words': 85}