<commit_before>module GoogleAppsHelper
  require 'google/api_client'
  require 'google/api_client/client_secrets'
  require 'google/api_client/auth/installed_app'

  def self.create_client
    # Initialize the client.
    @@client ||= Google::APIClient.new(
      :application_name => 'WREKtranet',
      :application_version => '0.0.1'
    )

    @@key ||= OpenSSL::PKey::RSA.new(ENV["GOOGLE_APPS_KEY"], 'notasecret')

    @@client.authorization = Signet::OAuth2::Client.new(
      token_credential_uri: 'https://accounts.google.com/o/oauth2/token',
      audience: 'https://accounts.google.com/o/oauth2/token',
      scope: ['https://www.googleapis.com/auth/admin.directory.user'],
      issuer: '2<EMAIL>',
      signing_key: @@key,
      person: '<EMAIL>'
    )

    @@client.authorization.fetch_access_token!

    return @@client
  end
end<commit_msg>moving some google apps info out into application.yml<commit_after>module GoogleAppsHelper
  require 'google/api_client'
  require 'google/api_client/client_secrets'
  require 'google/api_client/auth/installed_app'

  def self.create_client
    # Initialize the client.
    @@client ||= Google::APIClient.new(
      :application_name => 'WREKtranet',
      :application_version => '0.0.1'
    )

    @@key ||= OpenSSL::PKey::RSA.new(ENV["GOOGLE_APPS_KEY"], 'notasecret')

    @@client.authorization = Signet::OAuth2::Client.new(
      token_credential_uri: 'https://accounts.google.com/o/oauth2/token',
      audience: 'https://accounts.google.com/o/oauth2/token',
      scope: ['https://www.googleapis.com/auth/admin.directory.user'],
      issuer: ENV['GOOGLE_APPS_ISSUER'],
      signing_key: @@key,
      person: ENV['GOOGLE_APPS_PERSON']
    )

    @@client.authorization.fetch_access_token!

    return @@client
  end
end
{'fraction_non_alphanumeric': 0.14862591138530568, 'fraction_numerical': 0.007291082445316881, 'mean_word_length': 3.8086253369272236, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '2247074', 'n_tokens_mistral': 640, 'n_tokens_neox': 611, 'n_words': 88}