<commit_before>#Admin commands v2.1.1
import discord
import asyncio
from discord.ext import commands

from bot_globals import display_purges, server_list
from checks import *

class Admin():
    def __init__(self, bot):
        self.bot = bot

    ## Kick user
    @commands.command()
    @prefix('$')
    @permission(kick_members=True)
    async def kick(self, member: discord.Member):
        """Kick a user."""
        await self.bot.kick(member)
    
    ## Ban User
    @commands.command()
    @prefix('$')
    @permission(ban_members=True)
    async def ban(self, member: discord.Member, purge: int = 7):
        """Ban a user."""
        await self.bot.ban(member, purge)

    ## Purge messages
    @commands.group(pass_context=True)
    @prefix('$')
    @permission(manage_messages=True)
    async def purge(self, ctx):
        """Purge messages."""
        #The user is in fact doing it wrong
        if ctx.invoked_subcommand is None:
            await self.bot.say("Usage: `$purge <all | user | role> <target>`")
    
    #Handle the actual purging
    async def purge_messages(self, location, message, limit, check):
        removed = await self.bot.purge_from(message.channel,
        limit=limit, before=message, check=check)
        #Show info about the purge if the config says so
        if display_purges:
            reply = await self.bot.say("{0} message(s) were purged from {1}."
            .format(len(removed), location))
            await asyncio.sleep(4)
            await self.bot.delete_message(reply)
    
    @purge.command(pass_context=True)
    async def all(self, ctx, amt: int):
        """Remove all messages"""
        await self.purge_messages("everyone", ctx.message, amt, lambda e: True)
    
    @purge.command(pass_context=True)
    async def user(self, ctx, member: discord.Member, amt: int = 25):<commit_msg>Softban command<commit_after>#Admin commands v2.1.1
import discord
import asyncio
from discord.ext import commands

from bot_globals import display_purges, server_list
from checks import *

class Admin():
    def __init__(self, bot):
        self.bot = bot

    ## Kick user
    @commands.command()
    @prefix('$')
    @permission(kick_members=True)
    async def kick(self, member: discord.Member):
        """Kick a user."""
        await self.bot.kick(member)
    
    ## Ban User
    @commands.command()
    @prefix('$')
    @permission(ban_members=True)
    async def ban(self, member: discord.Member, purge: int = 7):
        """Ban a user."""
        await self.bot.ban(member, purge)
    
    ## Softban
    @commands.command()
    @prefix('$')
    @permission(ban_members=True)
    async def softban(self, member: discord.Member, purge: int = 1):
        """Softban (ban then unban) a user."""
        server = member.server
        await self.bot.ban(member, purge)
        await self.bot.unban(server, member)

    ## Purge messages
    @commands.group(pass_context=True)
    @prefix('$')
    @permission(manage_messages=True)
    async def purge(self, ctx):
        """Purge messages."""
        #The user is in fact doing it wrong
        if ctx.invoked_subcommand is None:
            await self.bot.say("Usage: `$purge <all | user | role> <target>`")
    
    #Handle the actual purging
    async def purge_messages(self, location, message, limit, check):
        removed = await self.bot.purge_from(message.channel,
        limit=limit, before=message, check=check)
        #Show info about the purge if the config says so
        if display_purges:
            reply = await self.bot.say("{0} message(s) were purged from {1}."
            .format(len(removed), location))
            await asyncio.sleep(4)
            await self.bot.delete_message(reply)
    
    @purge.command(pass_context=True)
    async def all(self, ctx, amt: int):
        """Remove all messages"""
        await self.purge_messages("everyone", ctx.message, amt, lambda e: True)
    
    @purge.command(pass_context=True)
    async def user(self, ctx, member: discord.Member, amt: int = 25):
{'fraction_non_alphanumeric': 0.12342007434944238, 'fraction_numerical': 0.004708798017348203, 'mean_word_length': 2.764925373134328, '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': '1329226', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1233, 'n_words': 346}