def _make_key_value_map(entity, property_names):
 value_map = dict(((name, []) for name in property_names))
 for prop in entity.property_list():
  if (prop.name() in value_map):
   value_map[prop.name()].append(datastore_types.PropertyValueToKeyValue(prop.value()))
 if (datastore_types.KEY_SPECIAL_PROPERTY in value_map):
  value_map[datastore_types.KEY_SPECIAL_PROPERTY] = [datastore_types.ReferenceToKeyValue(entity.key())]
 return value_map

def _make_key_value_map ( entity , property_names ) : value_map = dict ( ( ( name , [ ] ) for name in property_names ) ) for prop in entity . property_list ( ) : if ( prop . name ( ) in value_map ) : value_map [ prop . name ( ) ] . append ( datastore_types . PropertyValueToKeyValue ( prop . value ( ) ) ) if ( datastore_types . KEY_SPECIAL_PROPERTY in value_map ) : value_map [ datastore_types . KEY_SPECIAL_PROPERTY ] = [ datastore_types . ReferenceToKeyValue ( entity . key ( ) ) ] return value_map
extracts key values from the given entity .