#NEWLINE# def balance_value_for_ellipsis_args( self ) : #NEWLINE# #INDENT# ele_num = len ( self ) #NEWLINE# for ( index_1 , element ) in enumerate ( self , 1 ) : #NEWLINE# #INDENT# if ( index_1 == ele_num ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if isinstance ( element , OptionsShortcut ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( not element . matched ( ) ) : #NEWLINE# #INDENT# logger . debug ( '%r not matched at all' , element ) #NEWLINE# return False #NEWLINE# #UNINDENT# ellipsis_args = self . can_lend_value ( index_1 ) #NEWLINE# if ( ellipsis_args == 1 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ellipsis_args == 0 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# rest = self [ index_1 : ] #NEWLINE# assert rest , 'fixme: rest should not be empty' #NEWLINE# rest_args = self . can_borrow_value ( rest ) #NEWLINE# if ( rest_args is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if isinstance ( element , Required ) : #NEWLINE# #INDENT# return self . balance_required_value ( ellipsis_args , rest_args ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . balance_optional_value ( ellipsis_args , rest_args ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return False