def remove_cog(self, name):
cog = self.__cogs.pop(name, None)<EOL>if cog is None:<EOL><INDENT>return<EOL><DEDENT>help_command = self._help_command<EOL>if help_command and help_command.cog is cog:<EOL><INDENT>help_command.cog = None<EOL><DEDENT>cog._eject(self)<EOL>
Removes a cog from the bot.

        All registered commands and event listeners that the
        cog has registered will be removed as well.

        If no cog is found then this method has no effect.

        Parameters
        -----------
        name: :class:`str`
            The name of the cog to remove.