def _KindKeyToString(key):
 key_path = key.to_path()
 if ((len(key_path) == 2) and (key_path[0] == '__kind__') and isinstance(key_path[1], basestring)):
  return key_path[1]
 raise BadRequestError('invalid Key for __kind__ table')

def _KindKeyToString ( key ) : key_path = key . to_path ( ) if ( ( len ( key_path ) == 2 ) and ( key_path [ 0 ] == '__kind__' ) and isinstance ( key_path [ 1 ] , basestring ) ) : return key_path [ 1 ] raise BadRequestError ( 'invalid Key for __kind__ table' )
extract kind name from __kind__ key .