<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_whois(client, command, actor, args):
 """Parse the content responses from a WHOIS query. Individual response lines are parsed and used to fill in data in a buffer, the full contents of which are then sent as the argument to the WHOIS event dispatched when an ENDOFWHOIS line is received from the server. """

    _, _, args = args.partition(" ") # Strip off recipient, we know it"s us
    nick, _, args = args.partition(" ")
    if client.server._whois.get("nick") != nick:
        client.server._whois = {"nick": nick}
    response = client.server._whois

    if command == "WHOISUSER":
        first, _, response["realname"] = args.partition(":")
        response["username"], response["host"] = first.split()[:2]
        return

    if command == "WHOISISSERVER":
        response["server"], _, response["serverinfo"] = args.partition(" :")
        return

    if command == "WHOISOPERATOR":
        response["oper"] = True
        return

    if command == "WHOISIDLE":
        response["idle"], _, _ = args.partition(" :")
        response["idle"] = int(response["idle"])
        return

    if command == "WHOISCHANNELS":
        modes = "".join(client._get_prefixes())
        print repr(modes)
        channels = args.lstrip(":").split()
        response["channels"] = dict(
            (chan.lstrip(modes), chan[0] if chan[0] in modes else "")
            for chan in channels)
        return

    if command == "WHOISACCOUNT":
        response["account"], _, _ = args.partition(" :")
        return

    if command == "WHOISBOT":
        response["bot"] = True
        return

    if command == "WHOISREGNICK":
        response["registered"] = True
        return

    if command == "ENDOFWHOIS":
        client.dispatch_event("WHOIS", response)