#NEWLINE# def _KindKeyToString( key ) : #NEWLINE# #INDENT# "Extract kind name from __kind__ key.\n\n  Raises an ApplicationError if the key is not of the form '__kind__'/name.\n\n  Args:\n    key: a key for a __kind__ instance.\n  Returns:\n    kind specified by key.\n  " #NEWLINE# key_path = key . to_path ( ) #NEWLINE# if ( ( len ( key ) == 2 ) and ( key_path [ 0 ] == '__kind__' ) and isinstance ( key_path [ 1 ] , basestring ) ) : #NEWLINE# #INDENT# return key_path [ 1 ] #NEWLINE# #UNINDENT# raise BadRequestError ( 'invalid Key for __kind__ table' )