def _format_datastore_key(key):
 path = key.to_path()
 parts = []
 for i in range(0, (len(path) // 2)):
  kind = path[(i * 2)]
  value = path[((i * 2) + 1)]
  if isinstance(value, (int, long)):
   parts.append(('%s: id=%d' % (kind, value)))
  else:
   parts.append(('%s: name=%s' % (kind, value)))
 return ' > '.join(parts)

def _format_datastore_key ( key ) : path = key . to_path ( ) parts = [ ] for i in range ( 0 , ( len ( path ) // 2 ) ) : kind = path [ ( i * 2 ) ] value = path [ ( ( i * 2 ) + 1 ) ] if isinstance ( value , ( int , long ) ) : parts . append ( ( '%s: id=%d' % ( kind , value ) ) ) else : parts . append ( ( '%s: name=%s' % ( kind , value ) ) ) return ' > ' . join ( parts )
return a nicely formatted decomposition of a datastore key .