code: def _normalize_orders(self):
          
          orders = list(self._orders)
          _has_snapshot_cursor = False
  
          if self._start_at:
              if isinstance(self._start_at[0], document.DocumentSnapshot):
                  _has_snapshot_cursor = True
  
          if self._end_at:
              if isinstance(self._end_at[0], document.DocumentSnapshot):
                  _has_snapshot_cursor = True
  
          if _has_snapshot_cursor:
              should_order = [
                  _enum_from_op_string(key)
                  for key in _COMPARISON_OPERATORS
                  if key not in (_EQ_OP, "array_contains")
              ]
              order_keys = [order.field.field_path for order in orders]
              for filter_ in self._field_filters:
                  field = filter_.field.field_path
                  if filter_.op in should_order and field not in order_keys:
                      orders.append(self._make_order(field, "ASCENDING"))
              if not orders:
                  orders.append(self._make_order("__name__", "ASCENDING"))
              else:
                  order_keys = [order.field.field_path for order in orders]
                  if "__name__" not in order_keys:
                      direction = orders[-1].direction  # enum?
                      orders.append(self._make_order("__name__", direction))
  
          return orders
docs: Helper:  adjust orders based on cursors, where clauses.