<commit_before>class Payout::UpholdJob < ApplicationJob
  queue_as :scheduler

  def perform(should_send_notifications: false, manual: false, payout_report_id: nil, publisher_ids: [])

    if publisher_ids.present?
      publishers = Publisher.joins(:uphold_connection).where(id: publisher_ids)
    elsif manual
      publishers = Publisher.joins(:uphold_connection).publisher
    else
      publishers = Publisher.joins(:uphold_connection).with_verified_channel
    end

    if payout_report_id.present?
      payout_report = PayoutReport.find(payout_report_id)
      number_of_payments = PayoutReport.expected_num_payments(publishers)<commit_msg>Fix manual payout report job (#2683)<commit_after>class Payout::UpholdJob < ApplicationJob
  queue_as :scheduler

  def perform(should_send_notifications: false, manual: false, payout_report_id: nil, publisher_ids: [])

    if publisher_ids.present?
      publishers = Publisher.joins(:uphold_connection).where(id: publisher_ids)
    elsif manual
      publishers = Publisher.joins(:uphold_connection).invoice
    else
      publishers = Publisher.joins(:uphold_connection).with_verified_channel
    end

    if payout_report_id.present?
      payout_report = PayoutReport.find(payout_report_id)
      number_of_payments = PayoutReport.expected_num_payments(publishers)
{'fraction_non_alphanumeric': 0.07972665148063782, 'fraction_numerical': 0.0030372057706909645, 'mean_word_length': 5.101851851851852, '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': '7194247', 'n_tokens_mistral': 417, 'n_tokens_neox': 405, 'n_words': 68}