@staticmethod<EOL><INDENT>def parse_SAML_to_time(timestr):<DEDENT>
try:<EOL><INDENT>data = datetime.strptime(timestr, '<STR_LIT>')<EOL><DEDENT>except ValueError:<EOL><INDENT>data = datetime.strptime(timestr, '<STR_LIT>')<EOL><DEDENT>return calendar.timegm(data.utctimetuple())<EOL>
r"""
        Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z
        to a UNIX timestamp. The sub-second part is ignored.

        :param time: The time we should convert (SAML Timestamp).
        :type: string

        :return: Converted to a unix timestamp.
        :rtype: int