#NEWLINE# def _apply_key_type( self , keys ) : #NEWLINE# #INDENT# '\n        If a type is specified by the corresponding key dimension,\n        this method applies the type to the supplied key.\n        ' #NEWLINE# typed_key = ( ) #NEWLINE# for ( dim , key ) in zip ( self . kdims , keys ) : #NEWLINE# #INDENT# key_type = dim . type #NEWLINE# if ( key_type is None ) : #NEWLINE# #INDENT# typed_key += ( key , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( key , slice ) : #NEWLINE# #INDENT# sl_vals = [ key . start , key . stop , key . step ] #NEWLINE# typed_key += ( slice ( * [ ( key_type ( el ) if ( el is not None ) else None ) for el in sl_vals ] ) , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key is Ellipsis ) : #NEWLINE# #INDENT# typed_key += ( key , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( key , list ) : #NEWLINE# #INDENT# typed_key += ( [ key_type ( k ) for k in key ] , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# typed_key += ( key_type ( key ) , ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return typed_key