<commit_before>'use strict';
exports.info = {
  name: 'stats',
  desc: 'Posts statistics about this process/system/client',
  usage: 'stats',
};

const moment = require('moment');
const os = require('os');
const pusage = require('pidusage');

exports.run = (d, m) => {
  const nodeUp = moment.duration(process.uptime() * 1000);
  const totalMem = (os.totalmem() / 1024 / 1024).toFixed(0);
  const freeMem = (os.freemem() / 1024 / 1024).toFixed(0);
  const load = os.loadavg().map(x => (x * 100).toFixed(2));
  const osUp = moment.duration(os.uptime() * 1000);
  const cpuData = os.cpus();
  const usedRam = (totalMem - freeMem).toFixed(0);
  let members = 0;
  d.client.guilds.forEach(g => {
    members += g.members.size;
  });

  pusage.stat(process.pid, (err, stat) => {
    let cpu;
    if (err) {
      cpu = '--';
    } else {
      cpu = stat.cpu.toFixed(3);

      let str = '--Process Stats--\n';
      str += `Name: '${d.client.user.username} #${d.client.user.discriminator}' (ID: ${d.client.user.id})\n`;
      str += `Uptime: ${formatUptime(nodeUp)}\n`;
      str += `RAM: ${(process.memoryUsage().rss / 1024 / 1024).toFixed(2)}MB\n`;
      str += `CPU: ${cpu}%\n`;
      str += `Guilds: ${d.client.guilds.size}\n`;
      str += `Channels: ${d.client.channels.filter(c => c.type === 'text').size} text`;
      str += ` / ${d.client.channels.filter(c => c.type === 'voice').size} voice\n`;
      str += `Members: ${members}\n`;

      str += '\n--System Stats--\n';
      str += `OS: '${os.type()} - ${os.release()}'\n`;
      str += `Core${cpuData.length > 1 ? 's' : ''}: '${cpuData[0].model}' (${cpuData.length}x)\n`;<commit_msg>Header Change<commit_after>'use strict';
exports.info = {
  name: 'stats',
  desc: 'Posts statistics about this process/system/client',
  usage: 'stats',
};

const moment = require('moment');
const os = require('os');
const pusage = require('pidusage');

exports.run = (d, m) => {
  const nodeUp = moment.duration(process.uptime() * 1000);
  const totalMem = (os.totalmem() / 1024 / 1024).toFixed(0);
  const freeMem = (os.freemem() / 1024 / 1024).toFixed(0);
  const load = os.loadavg().map(x => (x * 100).toFixed(2));
  const osUp = moment.duration(os.uptime() * 1000);
  const cpuData = os.cpus();
  const usedRam = (totalMem - freeMem).toFixed(0);
  let members = 0;
  d.client.guilds.forEach(g => {
    members += g.members.size;
  });

  pusage.stat(process.pid, (err, stat) => {
    let cpu;
    if (err) {
      cpu = '--';
    } else {
      cpu = stat.cpu.toFixed(3);

      let str = '--Bot Stats--\n';
      str += `Name: '${d.client.user.username} #${d.client.user.discriminator}' (ID: ${d.client.user.id})\n`;
      str += `Uptime: ${formatUptime(nodeUp)}\n`;
      str += `RAM: ${(process.memoryUsage().rss / 1024 / 1024).toFixed(2)}MB\n`;
      str += `CPU: ${cpu}%\n`;
      str += `Guilds: ${d.client.guilds.size}\n`;
      str += `Channels: ${d.client.channels.filter(c => c.type === 'text').size} text`;
      str += ` / ${d.client.channels.filter(c => c.type === 'voice').size} voice\n`;
      str += `Members: ${members}\n`;

      str += '\n--System Stats--\n';
      str += `OS: '${os.type()} - ${os.release()}'\n`;
      str += `Core${cpuData.length > 1 ? 's' : ''}: '${cpuData[0].model}' (${cpuData.length}x)\n`;
{'fraction_non_alphanumeric': 0.23536585365853657, 'fraction_numerical': 0.026829268292682926, 'mean_word_length': 3.04064039408867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '2529826', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1224, 'n_words': 246}