<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fromstr(cls, s, *, strict=True):
 """ Construct a JID out of a string containing it. :param s: The string to parse. :type s: :class:`str` :param strict: Whether to enable strict parsing. :type strict: :class:`bool` :raises: See :class:`JID` :return: The parsed JID :rtype: :class:`JID` See the :class:`JID` class level documentation for the semantics of `strict`. """

        nodedomain, sep, resource = s.partition("/")
        if not sep:
            resource = None

        localpart, sep, domain = nodedomain.partition("@")
        if not sep:
            domain = localpart
            localpart = None
        return cls(localpart, domain, resource, strict=strict)