#NEWLINE# def maybe_droplevels( index , key ) : #NEWLINE# #INDENT# original_index = index #NEWLINE# if isinstance ( key , tuple ) : #NEWLINE# #INDENT# for _ in key : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# index = index . droplevel ( 0 ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return original_index #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# index = index . droplevel ( 0 ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return index