<commit_before>"""
lolbot - by <NAME>
Under MIT License
Copyright (c) <NAME> 2017

I am looking for developers.
Make a PR if you can help.

Hall of fame:
- Discord API - #python_discord-py
- Discord Bots - #development
and lastly, the Discord.py docs.
I wouldn't be here without them.
"""
# -*- coding: utf-8 -*-

# obviously, logging
import logging
logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO)
# execute some commands, may be deprecated later in favor of specific libraries
from subprocess import check_output
# a few things for stats
import sys
try:
  # discord.py has the core tools
  import discord
  from discord.ext import commands
  # git is also a module we need, for pulling
  import git
except ImportError:
  logging.warn('Module(s) could not be found/not installed')
  logging.warn('Installing automatically')
  try:
    check_output(['pip', 'install', '-Ur', 'requirements.txt'])
  except Exception:
    logging.error('Fatal error: pip failed to install dependencies')
    logging.error('Cannot continue run, exiting')
    logging.error('Try running this command:')
    sys.exit('pip install -Ur requirements.txt')
  else:
    sys.exit('Please relaunch lolbot')
else:
  logging.info('Found requirements, continuing')
# http, config, uptime
import aiohttp
import json
import time
# eval redir, 8ball
from contextlib import redirect_stdout as outredir
from random import choice as rchoice
try:
  config = json.loads(open('config.json').read())
except FileNotFoundError:
  logging.debug('Can\'t open config to start bot..')<commit_msg>[eval] import io<commit_after>"""
lolbot - by <NAME>
Under MIT License
Copyright (c) <NAME> 2017

I am looking for developers.
Make a PR if you can help.

Hall of fame:
- Discord API - #python_discord-py
- Discord Bots - #development
and lastly, the Discord.py docs.
I wouldn't be here without them.
"""
# -*- coding: utf-8 -*-

# obviously, logging
import logging
logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO)
# execute some commands, may be deprecated later in favor of specific libraries
from subprocess import check_output
# a few things for stats
import sys
try:
  # discord.py has the core tools
  import discord
  from discord.ext import commands
  # git is also a module we need, for pulling
  import git
except ImportError:
  logging.warn('Module(s) could not be found/not installed')
  logging.warn('Installing automatically')
  try:
    check_output(['pip', 'install', '-Ur', 'requirements.txt'])
  except Exception:
    logging.error('Fatal error: pip failed to install dependencies')
    logging.error('Cannot continue run, exiting')
    logging.error('Try running this command:')
    sys.exit('pip install -Ur requirements.txt')
  else:
    sys.exit('Please relaunch lolbot')
else:
  logging.info('Found requirements, continuing')
# http, config, uptime
import aiohttp
import json
import time
# eval redir, 8ball
import io
from contextlib import redirect_stdout as outredir
from random import choice as rchoice
try:
  config = json.loads(open('config.json').read())
except FileNotFoundError:
  logging.debug('Can\'t open config to start bot..')
{'fraction_non_alphanumeric': 0.1065909807631662, 'fraction_numerical': 0.003784295175023652, 'mean_word_length': 4.459552495697074, 'pattern_counts': {'":': 0, '<': 7, '<?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': '992761', 'n_tokens_mistral': 958, 'n_tokens_neox': 916, 'n_words': 357}