<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_assertion(self, ticket, attributes):
 """ Build a SAML 1.1 Assertion XML block. """

        assertion = etree.Element('Assertion')
        assertion.set('xmlns', 'urn:oasis:names:tc:SAML:1.0:assertion')
        assertion.set('AssertionID', self.generate_id())
        assertion.set('IssueInstant', self.instant())
        assertion.set('Issuer', 'localhost')
        assertion.set('MajorVersion', '1')
        assertion.set('MinorVersion', '1')
        assertion.append(self.get_conditions(ticket.service))
        subject = self.get_subject(ticket.user.get_username())
        if attributes:
            assertion.append(self.get_attribute_statement(subject, attributes))
        assertion.append(self.get_authentication_statement(subject, ticket))

        return assertion