<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_command(self, string):
 """Parse out any possible valid command from an input string."""

        possible_command, _, rest = string.partition(" ")
        # Commands are case-insensitive, stored as lowercase
        possible_command = possible_command.lower()
        if possible_command not in self.commands:
            return None, None

        event = self.commands[possible_command]["event"]
        args = shlex.split(rest.strip())
        return event, args