<commit_before>require 'octokit'
require 'pp'

# This class get info from github with octokit
class GithubInfo
  attr_reader :token_left

  def initialize
    @conf = ConfigApp.new
    Octokit.configure do |c|
      c.access_token = @conf.params['github']['tokens']['default']
    end
  end

  def list_orgas_repos
    repos = []
    orgs = @conf.params['github']['organizations']
    orgs.each do |org|
      Octokit.org_repos(org).each do |repo|
        repos.push({:full_name => repo['full_name'], :html_url => repo['html_url'], :open_issues_count => repo['open_issues_count']})
      end
    end
    @token_left = Octokit.last_response.headers[:x_ratelimit_remaining]
    repos
  end

  def list_orgas_pr
    prs = []
    repos = list_orgas_repos
    repos.each do |repo|
      Octokit.pull_requests(repo[:full_name]).each do |pr|
        prs.push({:title => pr['title']})<commit_msg>chore(github): use arguments for listing PR (reduce token consuption)<commit_after>require 'octokit'
require 'pp'

# This class get info from github with octokit
class GithubInfo
  attr_reader :token_left

  def initialize
    @conf = ConfigApp.new
    Octokit.configure do |c|
      c.access_token = @conf.params['github']['tokens']['default']
    end
  end

  def list_orgas_repos
    repos = []
    orgs = @conf.params['github']['organizations']
    orgs.each do |org|
      Octokit.org_repos(org).each do |repo|
        repos.push({:full_name => repo['full_name'], :html_url => repo['html_url'], :open_issues_count => repo['open_issues_count']})
      end
    end
    @token_left = Octokit.last_response.headers[:x_ratelimit_remaining]
    repos
  end

  def list_pr(list_repos)
    prs = []
    repos = list_repos
    repos.each do |repo|
      Octokit.pull_requests(repo[:full_name]).each do |pr|
        prs.push({:title => pr['title']})
{'fraction_non_alphanumeric': 0.13155021834061134, 'fraction_numerical': 0.0, 'mean_word_length': 3.593984962406015, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6762170', 'n_tokens_mistral': 647, 'n_tokens_neox': 620, 'n_words': 133}