Returns an empty DocumentSet sorted by the given comparator, then by keys.
544911
static DocumentSet emptySet(final Comparator<QueryDocumentSnapshot> comparator) {
    return new DocumentSet(
        EMPTY_DOCUMENT_MAP,
        new ImmutableSortedSet<>(Collections.<QueryDocumentSnapshot>emptyList(), comparator));
  }
839113
public void sortByDocID() {
        Collections.sort(this, new Comparator<RevisionInternal>() {
            public int compare(RevisionInternal rev1, RevisionInternal rev2) {
                return rev1.getDocID().compareTo(rev2.getDocID());
            }
        });
    }
401000
public static <T> ItemsSketch<T> getInstance(final Comparator<? super T> comparator) {
    return getInstance(PreambleUtil.DEFAULT_K, comparator);
  }
102538
def get_empty_ids(self):
        
        cursor = self.get_collection().find(
            {
                '_id': {'$in': self._document_ids},
                self._field: {'$exists': True}
            },
            {'_id': True}
        )

        return set(self._document_ids) - {doc['_id'] for doc in cursor}
1160254
def _sort_by_sortedset_before(self):
        
        return self._sort_by_sortedset and self._sort_limits and (not self._lazy_collection['pks']
                                                            or self._want_score_value)
832735
public void sort(@NonNull Comparator<? super T> comparator) {
        final ArrayList<T> copy = new ArrayList<>(mObjects);
        Collections.sort(copy, comparator);
        swap(copy);
    }
253767
public static boolean hasSameComparator(Comparator<?> comparator, Iterable<?> elements) {
    checkNotNull(comparator);
    checkNotNull(elements);
    Comparator<?> comparator2;
    if (elements instanceof SortedSet) {
      comparator2 = comparator((SortedSet<?>) elements);
    } else if (elements instanceof SortedIterable) {
      comparator2 = ((SortedIterable<?>) elements).comparator();
    } else {
      return false;
    }
    return comparator.equals(comparator2);
  }
13220
@Pure
	public static <T> TreeSet<T> newTreeSet(Comparator<? super T> comparator) {
		return new TreeSet<T>(comparator);
	}
804213
public function getByCondition($key, $comparator, $value = null)
    {
        $query = $this->createQuery();
        $conditionSet = $query->buildAndSet([$key, $comparator, $value]);
        return $this->getByConditionSet($conditionSet);
    }
34834
def comparable(self):
        """"""
        document_dict = self.compare_safe(self._document)

        # Remove uncompared fields
        self._remove_keys(document_dict, self._uncompared_fields)

        # Remove any empty values
        clean_document_dict = {}
        for k, v in document_dict.items():
            if not v and not isinstance(v, (int, float)):
                continue
            clean_document_dict[k] = v

        # Convert any referenced fields to Frames
        for ref_field, ref_cls in self._compared_refs.items():
            ref = getattr(self, ref_field)
            if not ref:
                continue

            # Check for fields which contain a list of references
            if isinstance(ref, list):
                if isinstance(ref[0], Frame):
                    continue

                # Dereference the list of reference IDs
                setattr(
                    clean_document_dict,
                    ref_field,
                    ref_cls.many(In(Q._id, ref))
                    )

            else:
                if isinstance(ref, Frame):
                    continue

                # Dereference the reference ID
                setattr(
                    clean_document_dict,
                    ref_field,
                    ref_cls.byId(ref)
                    )

        return clean_document_dict
1294357
public static SortedSet<String> sortedKeys(Map<String, String> map) {
        return new TreeSet<String>(map.keySet());
    }
756490
public Collection<String> getOrdererNames() {
        if (orderers == null) {
            return Collections.EMPTY_SET;
        } else {
            return new HashSet<>(orderers.keySet());
        }
    }
255786
public static <T> Reducer<PersistentSortedSet<T>,T> toPersistentSortedSet() {
        return Reducer.fromMonoid(Monoids.concatPersistentCollection(TreeSet.empty(Comparators.naturalOrderIdentityComparator())),
                a -> TreeSet.of(Comparators.naturalOrderIdentityComparator(),a));

    }
1308096
public static <K, V> SortedSetMultimap<K, V> createSortedSetMultiValueMap(Comparator<V> comparator) {
		return (SortedSetMultimap<K, V>) MultimapBuilder.hashKeys().treeSetValues(comparator);
	}
558096
def _compare_rows(from_recs, to_recs, keys):
    ""
    return set(
        k for k in keys
        if sorted(from_recs[k].items()) != sorted(to_recs[k].items())
    )
5185
def sorted_files_from_bucket(bucket, keys=None):
    
    keys = keys or []
    total = len(keys)
    sortby = dict(zip(keys, range(total)))
    values = ObjectVersion.get_by_bucket(bucket).all()
    return sorted(values, key=lambda x: sortby.get(x.key, total))
686804
def _collection(self):
        
        old_sort_limits_and_len_mode = None if self._sort_limits is None else self._sort_limits.copy(), self._len_mode
        try:  # try block to always reset the _sort_limits in the "finally" part

            conn = self.cls.get_connection()
            self._len = 0

            # The collection fails (empty) if more than one pk or if the only one
            # doesn't exists
            try:
                pk = self._get_pk()
            except ValueError:
                return []
            else:
                if pk is not None and not self.cls.get_field('pk').exists(pk):
                    return []

            # Prepare options and final set to get/sort
            sort_options = self._prepare_sort_options(bool(pk))

            final_set, keys_to_delete = self._get_final_set(
                                                self._lazy_collection['sets'],
                                                pk, sort_options)

            if self._len_mode:
                if final_set is None:
                    if pk and not self._lazy_collection['sets']:
                        # we have a only pk
                        self._len = 1
                    else:
                        # we have nothing
                        self._len = 0
                else:
                    self._len = self._collection_length(final_set)
                    if keys_to_delete:
                        conn.delete(*keys_to_delete)

                # return nothing
                return

            else:

                # fill the collection
                if final_set is None:
                    if pk and not self._lazy_collection['sets']:
                        # we have a pk without other sets, and no
                        # needs to get values so we can simply return the pk
                        collection = {pk}
                    else:
                        # we have nothing
                        collection = {}
                else:
                    # compute the sets and call redis te retrieve wanted values
                    collection = self._final_redis_call(final_set, sort_options)
                    if keys_to_delete:
                        conn.delete(*keys_to_delete)

                # Format return values if needed
                return self._prepare_results(collection)
        finally:
            self._sort_limits, self._len_mode = old_sort_limits_and_len_mode