#NEWLINE# def _slice_subset_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 instances cannot be defined by a slice with negative start, stop or step arguments' ) #NEWLINE# #UNINDENT# if ( ( slice_ . step is not None ) and ( slice_ . step != 1 ) ) : #NEWLINE# #INDENT# raise ValueError ( "Subset doesn't support slices with a step greater than 1" ) #NEWLINE# #UNINDENT# if ( ( slice_ . stop is not None ) and ( slice_ . stop > num_examples ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Subset instances cannot be defined by a slice whose stop value is greater than the original number of examples' ) #NEWLINE# #UNINDENT# if ( ( slice_ . start is not None ) and ( slice_ . start >= num_examples ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Subset instances cannot be defined by a slice whose start value is greater than or equal to the original number of examples' ) #NEWLINE# #UNINDENT# if ( ( slice_ . start is not None ) and ( slice_ . stop is not None ) and ( slice_ . start > slice_ . stop ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Subset instances cannot be defined by a slice whose start value is greater than its stop value' )