<commit_before>
module SalesForceSushi
  class Client < Restforce::Client

    def initialize(user = User.first)
      @client = self.class.client(user)
    end

    def zoho
      @zoho ||= ZohoSushi.client
    end

    def custom_query(string = nil)
      result = @client.query(string ||  "select Id, Zoho_ID__c, Account.Name, CloseDate from Opportunity limit 1")
      result.entries.delete_if do |entity|
        SalesForceProgressRecord.first(sales_force_id: entity.fetch('Id'), complete: true)
      end.map do |entity|
        SalesForceSushi::Opportunity.new(entity)
      end
    end

    def self.client(user = User.first)
      Restforce.new oauth_token: user.auth_token,
        refresh_token: <PASSWORD>_token,
        instance_url: $cnf.fetch('salesforce')['instance_url'],
        client_id:  $cnf.fetch('salesforce')['api_key'],<commit_msg>add an option to yeild to another block<commit_after>
module SalesForceSushi
  class Client < Restforce::Client

    def initialize(user = User.first)
      @client = self.class.client(user)
    end

    def zoho
      @zoho ||= ZohoSushi.client
    end

    def custom_query(string = nil)
      result = @client.query(string ||  "select Id, Zoho_ID__c, Account.Name, CloseDate from Opportunity limit 1")
      result.entries.delete_if do |entity|
        SalesForceProgressRecord.first(sales_force_id: entity.fetch('Id'), complete: true)
      end.map do |entity|
        yield SalesForceSushi::Opportunity.new(entity) if block_given?
        SalesForceSushi::Opportunity.new(entity)
      end
    end

    def self.client(user = User.first)
      Restforce.new oauth_token: user.auth_token,
        refresh_token: <PASSWORD>,
        instance_url: $cnf.fetch('salesforce')['instance_url'],
        client_id:  $cnf.fetch('salesforce')['api_key'],
{'fraction_non_alphanumeric': 0.11080332409972299, 'fraction_numerical': 0.00110803324099723, 'mean_word_length': 3.3102625298329356, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '644664', 'n_tokens_mistral': 599, 'n_tokens_neox': 559, 'n_words': 122}