@staticmethod
    def fromElement(element):
        """
        Create an instance from a domish Element.
        """
        try:
            stamp = parse(element[u'stamp'])

            # Assume UTC if no timezone was given
            if stamp.tzinfo is None:
                stamp = stamp.replace(tzinfo=tzutc())
        except (KeyError, ValueError):
            stamp = None

        try:
            sender = JID(element[u'from'])
        except (__HOLE__, InvalidFormat):
            sender = None

        delay = Delay(stamp, sender)
        return delay
dataset/ETHPy150Open ralphm/wokkel/wokkel/delay.py/Delay.fromElement