#NEWLINE# def submit_form_locally( instance , domain , **kwargs ) : #NEWLINE# #INDENT# kwargs [ 'auth_context' ] = ( kwargs . get ( 'auth_context' ) or DefaultAuthContext ( ) ) #NEWLINE# ( response , xform , cases ) = SubmissionPost ( domain = domain , instance = instance , ** kwargs ) . run ( ) #NEWLINE# if ( not ( 200 <= response . status_code < 300 ) ) : #NEWLINE# #INDENT# raise LocalSubmissionError ( ( 'Error submitting (status code %s): %s' % ( xform . status_code , response . content ) ) ) #NEWLINE# #UNINDENT# return ( response , xform , cases )