def Normalize(filters, orders):

  for f in filters:
    if f.op() == datastore_pb.Query_Filter.IN and f.property_size() == 1:
      f.set_op(datastore_pb.Query_Filter.EQUAL);

  eq_properties = set([f.property(0).name() for f in filters if f.op() == datastore_pb.Query_Filter.EQUAL]);

  remove_set = eq_properties.copy()
  new_orders = []
  for o in orders:
    if o.property() not in remove_set:
      remove_set.add(o.property())
      new_orders.append(o)
  orders = new_orders


  if datastore_types._KEY_SPECIAL_PROPERTY in eq_properties:
    orders = []

  new_orders = []
  for o in orders:
    if o.property() == datastore_types._KEY_SPECIAL_PROPERTY:
      new_orders.append(o)
      break
    new_orders.append(o)
  orders = new_orders

  return (filters, orders)
Endpoints common to launching any job with template #1 and
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/datastore/datastore_index.py/Normalize--crossover with--dataset/ETHPy150Open ansible/tower-cli/tests/test_resources_job.py/standard_registration