<commit_before>import random
import re
from typing import Any, Mapping, Optional

import discord
from discord.ext import commands
from discord.ext.commands import Cog

from bot import BeattieBot
from context import BContext
from utils.exceptions import ResponseError


class XKCD(Cog):
    def __init__(self) -> None:
        with open("data/why.txt", encoding="utf8") as file:
            self.questions: tuple[str, ...] = tuple(file.readlines())

    @commands.command()
    async def why(self, ctx: BContext) -> None:
        """Asks a question."""
        await ctx.send(random.choice(self.questions))

    @commands.group()
    async def xkcd(self, ctx: BContext, *, inp: Optional[str] = None) -> None:
        """Commands for getting xkcd comics"""
        async with ctx.typing():<commit_msg>Remove redundant Optional from signature<commit_after>import random
import re
from typing import Any, Mapping

import discord
from discord.ext import commands
from discord.ext.commands import Cog

from bot import BeattieBot
from context import BContext
from utils.exceptions import ResponseError


class XKCD(Cog):
    def __init__(self) -> None:
        with open("data/why.txt", encoding="utf8") as file:
            self.questions: tuple[str, ...] = tuple(file.readlines())

    @commands.command()
    async def why(self, ctx: BContext) -> None:
        """Asks a question."""
        await ctx.send(random.choice(self.questions))

    @commands.group()
    async def xkcd(self, ctx: BContext, *, inp: str = None) -> None:
        """Commands for getting xkcd comics"""
        async with ctx.typing():
{'fraction_non_alphanumeric': 0.11651090342679128, 'fraction_numerical': 0.0012461059190031153, 'mean_word_length': 3.412087912087912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6759981', 'n_tokens_mistral': 482, 'n_tokens_neox': 465, 'n_words': 152}