def get_v1_mutation_key_and_entity(v1_mutation):
 if v1_mutation.HasField('delete'):
  return (v1_mutation.delete, None)
 else:
  v1_entity = getattr(v1_mutation, v1_mutation.WhichOneof('operation'))
  return (v1_entity.key, v1_entity)

def get_v1_mutation_key_and_entity ( v1_mutation ) : if v1_mutation . HasField ( 'delete' ) : return ( v1_mutation . delete , None ) else : v1_entity = getattr ( v1_mutation , v1_mutation . WhichOneof ( 'operation' ) ) return ( v1_entity . key , v1_entity )
returns the v1 key and entity for a v1 mutation proto .