Sorts the internal list of factories by priority.
324399
private function sortFactories()
    {
        $this->sorted = [];

        krsort($this->factories);
        $this->sorted = call_user_func_array('array_merge', $this->factories);
    }
545242
def _sort(self):
        """"""
        self.__dict__['_z_ordered_sprites'] = sorted(self.sprites, key=lambda sprite:sprite.z_order)
514697
private static <V> Collection<V> sorted(Iterable<V> source, Comparator<V> comparator, int size)
    {
        V[] vs = (V[]) new Object[size];
        int i = 0;
        for (V v : source)
            vs[i++] = v;
        Arrays.sort(vs, comparator);
        return Arrays.asList(vs);
    }
549502
public Priority[] getPriorities() {
        List<Priority> actualPriorities = new ArrayList<Priority>();
        for (String priority : getAvailablePriorities()) {
            if (provider.getNumberOfAnnotations(priority) > 0) {
                actualPriorities.add(Priority.fromString(priority));
            }
        }
        return actualPriorities.toArray(new Priority[actualPriorities.size()]);
    }
1174140
def sort(self):
        """"""
        super(JSSObjectList, self).sort(key=lambda k: k.id)
765110
@Override
	public AppEngineGetList<E> sort(Order<?, ?>... orders) {
		if (orders == null) {
			throw new IllegalArgumentException("'orders' must not be [" + orders + "]");
		}
		
		this.orders = Arrays.asList(orders);
		return this;
	}
658546
public static <T, L extends List<T>> L sortThis(L list, Comparator<? super T> comparator)
    {
        if (list instanceof MutableList)
        {
            ((MutableList<T>) list).sortThis(comparator);
        }
        else if (list instanceof ArrayList)
        {
            ArrayListIterate.sortThis((ArrayList<T>) list, comparator);
        }
        else
        {
            if (list.size() > 1)
            {
                Collections.sort(list, comparator);
            }
        }
        return list;
    }
652822
public function addFactory(ProcessorFactoryInterface $factory, $priority = 0)
    {
        $this->factories[$priority][] = $factory;
        // sort by priority and flatten
        // we do it here due to performance reasons (it is expected that it will be only several factories,
        // but the getProcessor method will be called a lot of times)
        \krsort($this->factories);
        $this->sortedFactories = \array_merge(...$this->factories);
    }
137152
def __sort_up(self):

        """"""
        if self.__do_need_sort_up:
            self.__up_objects.sort(key=cmp_to_key(self.__up_cmp))
            self.__do_need_sort_up = False
992229
public static void sort(int[] data, int start, int end, IntComparator comp) {
    quickSort(data, start, end, comp);
  }
728173
def _priority(s):
    """"""
    if type(s) in (list, tuple, set, frozenset):
        return ITERABLE
    if type(s) is dict:
        return DICT
    if issubclass(type(s), type):
        return TYPE
    if hasattr(s, "validate"):
        return VALIDATOR
    if callable(s):
        return CALLABLE
    else:
        return COMPARABLE
220285
function sortMainFirst(main) {
  return (entity1, entity2) => {
    if (entity1.key === main.key) {
      return -1;
    }
    else if (entity2.key === main.key) {
      return 1;
    }
    return 0;
  };
}
430933
def _sort_r(sorted, processed, key, deps, dependency_tree):
    """"""
    if key in processed:
        return
    processed.add(key)
    for dep_key in deps:
        dep_deps = dependency_tree.get(dep_key)
        if dep_deps is None:
            log.debug('"%s" not found, skipped', Repr(dep_key))
            continue
        _sort_r(sorted, processed, dep_key, dep_deps, dependency_tree)
    sorted.append((key, deps))
1110900
private function sortMaps()
    {
        uasort($this->activeMaps, function(PrioritizedMap $m1, PrioritizedMap $m2) {
            if ($p = $m2->priority - $m1->priority)
                return $p;
            return $m1->priority2 - $m2->priority2;
        });
    }
1059925
def priority(self,priority):
        
        with self.__lock:
            old_priorities = {}
            try:
                for thread in self.__threads:
                    old_priorities[thread] = thread.priority
                    thread.priority = priority
            except Exception:
                for (thread,old_priority) in old_priorities.iteritems():
                    try:
                        thread.priority = old_priority
                    except Exception:
                        pass
                raise
            else:
                self.__priority = priority
108471
private void invokeInitializersBasedOnPriority(ITestContext context) {
        ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class);
        List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>();
        for (Initializer l : serviceLoader) {
            loader.add((AbstractConfigInitializer) l);
        }
        Collections.sort(loader);
        for (AbstractConfigInitializer temp : loader) {
            temp.initialize(context);
        }
    }
1064504
private SortedMap<String, ModelProperty> sort(Map<String, ModelProperty> modelProperties) {

    SortedMap<String, ModelProperty> sortedMap = new TreeMap<String, ModelProperty>(defaultOrdering(modelProperties));
    sortedMap.putAll(modelProperties);
    return sortedMap;
  }