<commit_before>class RequestToken < OauthToken
  def authorize!(user)
    return false if authorized?
    self.user = user
    self.authorized_at = Time.now
    self.save
  end
  
  def exchange!
    return false unless authorized?
    RequestToken.transaction do
      logger.info("£££ In exchange!")
      params = { :user => user, :client_application => client_application }
      # copy the permissions from the authorised request token to the access token
      client_application.permissions.each { |p| 
        logger.info("£££ copying permission #{p} = #{read_attribute(p).inspect}")
        params[p] = read_attribute(p)
      }

      access_token = AccessToken.create(params)
      invalidate!
      access_token
    end
  end
end<commit_msg>Removed debugging statements accidentally committed.<commit_after>class RequestToken < OauthToken
  def authorize!(user)
    return false if authorized?
    self.user = user
    self.authorized_at = Time.now
    self.save
  end
  
  def exchange!
    return false unless authorized?
    RequestToken.transaction do
      params = { :user => user, :client_application => client_application }
      # copy the permissions from the authorised request token to the access token
      client_application.permissions.each { |p| 
        params[p] = read_attribute(p)
      }

      access_token = AccessToken.create(params)
      invalidate!
      access_token
    end
  end
end
{'fraction_non_alphanumeric': 0.08140350877192983, 'fraction_numerical': 0.0, 'mean_word_length': 3.00561797752809, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7219073', 'n_tokens_mistral': 396, 'n_tokens_neox': 388, 'n_words': 113}