<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(cls, prefix):
 """ Extracts informations from `prefix`. :param prefix: prefix with format ``<servername>|<nick>['!'<user>]['@'<host>]``. :type prefix: unicode :return: extracted informations (nickname or host, mode, username, host). :rtype: tuple(str, str, str, str) """

        try:
            nick, rest = prefix.split(u'!')
        except ValueError:
            return prefix, None, None, None
        try:
            mode, rest = rest.split(u'=')
        except ValueError:
            mode, rest = None, rest
        try:
            user, host = rest.split(u'@')
        except ValueError:
            return nick, mode, rest, None
        return nick, mode, user, host