Python 3.9 is now generally available.

google.appengine.datastore.datastore_stub_util.CompareEntityPbByKey

Compare two entity protobuf's by key.

a entity_pb2.EntityProto to compare
b entity_pb2.EntityProto to compare

<0 if a's key is before b's, =0 if they are the same key, and >0 otherwise.