#NEWLINE# def get_loc( self , key , method = None , tolerance = None ) : #NEWLINE# #INDENT# '\n        Get integer location for requested label\n\n        Returns\n        -------\n        loc : int\n        ' #NEWLINE# if ( tolerance is not None ) : #NEWLINE# #INDENT# tolerance = self . _convert_tolerance ( tolerance ) #NEWLINE# #UNINDENT# if isinstance ( key , datetime ) : #NEWLINE# #INDENT# key = Timestamp ( key , tz = self . tz ) #NEWLINE# return Index . get_loc ( self , key , method , tolerance ) #NEWLINE# #UNINDENT# if isinstance ( key , time ) : #NEWLINE# #INDENT# if ( method is not None ) : #NEWLINE# #INDENT# raise NotImplementedError ( 'cannot yet lookup inexact labels when key is a time object' ) #NEWLINE# #UNINDENT# return self . indexer_at_time ( key ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return Index . get_loc ( self , key , method , tolerance ) #NEWLINE# #UNINDENT# except ( KeyError , ValueError , TypeError ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return self . _get_string_slice ( key ) #NEWLINE# #UNINDENT# except ( TypeError , KeyError , ValueError ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# stamp = Timestamp ( key , tz = self . tz ) #NEWLINE# return Index . get_loc ( self , stamp , method , tolerance ) #NEWLINE# #UNINDENT# except ( KeyError , ValueError ) : #NEWLINE# #INDENT# raise KeyError ( key )