#NEWLINE# def last_or_default_async( source , has_default = False , default_value = None ) : #NEWLINE# #INDENT# def subscribe( observer ) : #NEWLINE# #INDENT# value = [ default_value ] #NEWLINE# seen_value = [ False ] #NEWLINE# def on_next( x ) : #NEWLINE# #INDENT# value [ 0 ] = x #NEWLINE# seen_value [ 0 ] = True #NEWLINE# #UNINDENT# def on_completed( ) : #NEWLINE# #INDENT# if ( ( not seen_value [ 0 ] ) and ( not has_default ) ) : #NEWLINE# #INDENT# observer . on_error ( SequenceContainsNoElementsError ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# observer . on_next ( value [ 0 ] ) #NEWLINE# observer . on_completed ( ) #NEWLINE# #UNINDENT# #UNINDENT# return source . subscribe ( on_next , observer . on_error , on_completed ) #NEWLINE# #UNINDENT# return AnonymousObservable ( default_value )