<commit_before>class Pupil
  def lookup(opts, option={})
    target, source = opts.to_a.first
    case target
    when :users
      response = self.get("/1/users/lookup.json", {guess_parameter(source[0]) => source.join(",")}.update(option))
      return false unless response
      users = Array.new
      response.each do |element|
        user = User.new(element, @access_token)
        users << user
      end
      return users
    when :friendships
      response = self.get("/1/friendships/lookup.json", {guess_parameter(source[0]) => source.join(",")}.update(option))
      return false unless response
      fs = Array.new
      response.each do |element|
        fs << element
      end
      return fs
    else
      raise ArgumentError, "#{target} is invalid parameter"
    end
  end
  
  def method_missing(action, *args)
    # e.g. pupil.users_search("username", :method => :post)
    url = "/1/#{action.to_s.split('_').join('/')}.json"
    response = self.get(url, args)
    return response
  end
end<commit_msg>Lookup all pages<commit_after>class Pupil
  def lookup(opts, option={})
    target, source = opts.to_a.first
    case target
    when :users
      users = Array.new
      source.each_slice(100) do |sliced|
        response = self.get("/1/users/lookup.json", {guess_parameter(sliced[0]) => sliced.join(",")}.update(option))
        return false unless response
        response.each do |element|
          user = User.new(element, @access_token)
          users << user
        end
      end
      
      return users
    when :friendships
      fs = Array.new
      source.each_slice(100) do |sliced|
        response = self.get("/1/friendships/lookup.json", {guess_parameter(sliced[0]) => sliced.join(",")}.update(option))
        return false unless response

        response.each do |element|
          fs << element
        end
      end
      
      return fs
    else
      raise ArgumentError, "#{target} is invalid parameter"
    end
  end
  
  def method_missing(action, *args)
    # e.g. pupil.users_search("username", :method => :post)
    url = "/1/#{action.to_s.split('_').join('/')}.json"
    response = self.get(url, args)
    return response
  end
end
{'fraction_non_alphanumeric': 0.13217866909753875, 'fraction_numerical': 0.007292616226071103, 'mean_word_length': 2.5063897763578273, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '1264175', 'n_tokens_mistral': 680, 'n_tokens_neox': 676, 'n_words': 165}