#NEWLINE# def _slice_request_sanity_check( self , slice_ , num_examples ) : #NEWLINE# #INDENT# numeric_args = ( arg for arg in ( slice_ . start , slice_ . stop , slice_ . step ) if ( arg is not None ) ) #NEWLINE# if any ( ( ( arg < 0 ) for arg in numeric_args ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Subset does not support slice-based requests with negative start, stop or step arguments' ) #NEWLINE# #UNINDENT# if ( ( slice_ . stop is not None ) and ( slice_ . stop > num_examples ) ) : #NEWLINE# #INDENT# raise ValueError ( 'slice-based requests cannot have a stop value greater than the number of examples the subset spans (this would produce a return value with smaller length than expected' ) #NEWLINE# #UNINDENT# if ( ( slice_ . start is not None ) and ( slice_ . start >= num_examples ) ) : #NEWLINE# #INDENT# raise ValueError ( 'slice-based requests cannot have a start value greater than the number of examples the subset spans (this would produce an empty return value)' ) #NEWLINE# #UNINDENT# if ( ( slice_ . start is not None ) and ( slice_ . stop is not None ) and ( slice_ . start >= slice_ . stop ) ) : #NEWLINE# #INDENT# raise ValueError ( 'slice-based requests cannot have a start value greater than or equal to its stop value (this would produce an empty return value)' )