<commit_before>class UpdateUserRepositories
  include GithubInteractor

  delegate :user, to: :context

  def call
    user.member_repositories = all_repositories.map { |h|
      FindOrCreateRepository.call(data: h).record
    }.to_a
  end

  private

  def all_repositories
    paginate { client.repositories }<commit_msg>Double check user repositories are readable<commit_after>class UpdateUserRepositories
  include GithubInteractor

  delegate :user, to: :context

  def call
    user.member_repositories = all_repositories.map { |h|
      # double check the repository does exist
      # listing all repos will occasionally yield "dead" / removed repositories
      begin
        data = client.repo(h.full_name)
      rescue Octokit::NotFound
        next
      end
      FindOrCreateRepository.call(data: data).record
    }.to_a.compact
  end

  private

  def all_repositories
    paginate { client.repositories }
{'fraction_non_alphanumeric': 0.0641304347826087, 'fraction_numerical': 0.0, 'mean_word_length': 3.3443396226415096, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3859378', 'n_tokens_mistral': 282, 'n_tokens_neox': 257, 'n_words': 71}