def authn_statement(authn_class=None, authn_auth=None, authn_decl=None, authn_decl_ref=None, authn_instant='', subject_locality=''):
 if authn_instant:
  _instant = instant(time_stamp=authn_instant)
 else:
  _instant = instant()
 if authn_class:
  res = factory(saml.AuthnStatement, authn_instant=_instant, session_index=sid(), authn_context=_authn_context_class_ref(authn_class, authn_auth))
 elif authn_decl:
  res = factory(saml.AuthnStatement, authn_instant=_instant, session_index=sid(), authn_context=_authn_context_decl(authn_decl, authn_auth))
 elif authn_decl_ref:
  res = factory(saml.AuthnStatement, authn_instant=_instant, session_index=sid(), authn_context=_authn_context_decl_ref(authn_decl_ref, authn_auth))
 else:
  res = factory(saml.AuthnStatement, authn_instant=_instant, session_index=sid())
 if subject_locality:
  res.subject_locality = saml.SubjectLocality(text=subject_locality)
 return res

def authn_statement ( authn_class = None , authn_auth = None , authn_decl = None , authn_decl_ref = None , authn_instant = '' , subject_locality = '' ) : if authn_instant : _instant = instant ( time_stamp = authn_instant ) else : _instant = instant ( ) if authn_class : res = factory ( saml . AuthnStatement , authn_instant = _instant , session_index = sid ( ) , authn_context = _authn_context_class_ref ( authn_class , authn_auth ) ) elif authn_decl : res = factory ( saml . AuthnStatement , authn_instant = _instant , session_index = sid ( ) , authn_context = _authn_context_decl ( authn_decl , authn_auth ) ) elif authn_decl_ref : res = factory ( saml . AuthnStatement , authn_instant = _instant , session_index = sid ( ) , authn_context = _authn_context_decl_ref ( authn_decl_ref , authn_auth ) ) else : res = factory ( saml . AuthnStatement , authn_instant = _instant , session_index = sid ( ) ) if subject_locality : res . subject_locality = saml . SubjectLocality ( text = subject_locality ) return res
construct the authnstatement .