<commit_before>#!/usr/bin/env ruby

# User Audit - Generated with Octokitchen https://github.com/kylemacey/octokitchen

# Dependencies
require "octokit"

Octokit.configure do |kit|
  kit.auto_paginate = true
end

client = Octokit::Client.new
users = client.all_users
n = 1
puts "Importing users..."
full_users = users.map { |u|
  print "\r#{n}/#{users.count}"
  n += 1
  client.user(u.login) rescue nil;
}

suspended = full_users.select do |u|
  next unless u
  !u.suspended_at.nil? rescue false;
end

active = full_users.select do |u|
  next unless u
  u.suspended_at.nil? rescue false;
end

two_days = 172800
recent = suspended.select do |u|
  u[:suspended_at] > (Time.now - two_days)
end

puts ""
puts ""
puts "Suspended: #{suspended.count}"
puts "Recently Suspended: #{recent.count}"<commit_msg>Use more verbose variable name Change language for loading user data<commit_after>#!/usr/bin/env ruby

# User Audit - Generated with Octokitchen https://github.com/kylemacey/octokitchen

# Dependencies
require "octokit"

Octokit.configure do |kit|
  kit.auto_paginate = true
end

client = Octokit::Client.new
users = client.all_users
n = 1
puts "Aggregating users..."
full_users = users.map { |u|
  print "\r#{n}/#{users.count}"
  n += 1
  client.user(u.login) rescue nil;
}

suspended = full_users.select do |u|
  next unless u
  !u.suspended_at.nil? rescue false;
end

active = full_users.select do |u|
  next unless u
  u.suspended_at.nil? rescue false;
end

seconds_in_two_days = 60 * # seconds in an minute
                      60 * # minutes in an hour
                      48   # hours in 2 days

recent = suspended.select do |u|
  u[:suspended_at] > (Time.now - seconds_in_two_days)
end

puts ""
puts ""
puts "Suspended: #{suspended.count}"
puts "Recently Suspended: #{recent.count}"
{'fraction_non_alphanumeric': 0.12332589285714286, 'fraction_numerical': 0.009486607142857142, 'mean_word_length': 3.657142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '4134720', 'n_tokens_mistral': 678, 'n_tokens_neox': 647, 'n_words': 177}