sorts the list of plugins according to their execution order
963824
private function sortPlugins($plugins)
    {
        usort($plugins, function ($a, $b) {
            return $a->getExecutionOrder() - $b->getExecutionOrder();
        });
        return $plugins;
    }
1150560
def _iterator(self, plugins, context):
        

        test = pyblish.logic.registered_test()

        for plug, instance in pyblish.logic.Iterator(plugins, context):
            if not plug.active:
                continue

            if instance is not None and instance.data.get("publish") is False:
                continue

            self.processing["nextOrder"] = plug.order

            if not self.is_running:
                raise StopIteration("Stopped")

            if test(**self.processing):
                raise StopIteration("Stopped due to %s" % test(
                    **self.processing))

            yield plug, instance
668717
def run_plugins(self):
        
        for obj in self.loader.objects:
            # Reserve a slot in the output_dict in order to ensure that the
            # items are in the correct order.
            self.output_dict[obj.output_options['name']] = None
            self.thread_manager.add_thread(obj.main, obj.options['interval'])
528902
function sortDjangoVersions(versions) {
  return versions.sort((a, b) => {
    if (
      parseDjangoVersionString(a).major === parseDjangoVersionString(b).major
    ) {
      return (
        parseDjangoVersionString(a).minor - parseDjangoVersionString(b).minor
      )
    } else {
      return (
        parseDjangoVersionString(a).major - parseDjangoVersionString(b).major
      )
    }
  })
}
306680
def order_results_by(*fields):
    
    def decorator(f):
        @functools.wraps(f)
        def wrapper(*args, **kw):
            result = f(*args, **kw)
            return result.order_by(*fields)
        return wrapper
    return decorator
924104
def order_module_dependencies(modules, parser):
    """"""
    result = []        
    for modk in modules:
        if modk not in result:
            result.append(modk)

    #We also need to look up the dependencies of each of these modules
    recursed = list(result)
    for i in range(len(result)):
        module = result[i]
        _process_module_order(parser, module, i, recursed)

    return recursed
600834
def plugins(self, deduplicate=False):
        '''
            
        '''
        plugins = []
        for c in self.components:
            if hasattr(c, 'plugins'):
                plugins += c.plugins()
            elif isinstance(c, Lib):
                plugins.append(c)
            elif hasattr(c, 'is_plugin') and c.is_plugin:
                plugins.append(c)

        if deduplicate:
            plugins = list(OrderedDict.fromkeys(plugins))
        return plugins
795258
def find_plugins():
     
    plugin_dir = os.path.dirname(os.path.realpath(__file__))
    plugin_dir = os.path.join(plugin_dir, "plugins")
    plugin_files = [x[:-3] for x in os.listdir(plugin_dir) if x.endswith(".py")]
    sys.path.insert(0, plugin_dir)
    for plugin in plugin_files:
        __import__(plugin)
1307141
@Deprecated
	public static <S, T extends Plugin<S>> OrderAwarePluginRegistry<T, S> create(List<? extends T> plugins) {
		return of(plugins, DEFAULT_COMPARATOR);
	}
460943
def sort_by_name(self):
        """"""
        super(JSSObjectList, self).sort(key=lambda k: k.name)
1333573
def sort_order(options = {})
      [[prefix, last].compact.join(' '), suffix, options[:initials] ? initials : first].compact.join(', ')
    end
331550
function (plugins, func) {
                var idx, plugin = null;
                // iterate to process in reverse order without side-effects.
                for (idx = 1; idx <= plugins.length; idx += 1) {
                    plugin = plugins[plugins.length - idx];
                    func(plugin);
                    if (plugin.stopProcessing) {
                        break;
                    }
                }
            }
147749
def list_plugins():
    
    plugin_eps = pkg_resources.iter_entry_points('ofxstatement')
    return sorted((ep.name, ep.load()) for ep in plugin_eps)
578166
def get_ordering(self):
        """"""
        if self.sorting_field:
            return [self.sorting_field]
        prefix = self.get_prefix()
        fields = self.get_ordering_with_prefix()
        if self.prefix:
            fields = [f.replace(prefix, "", 1) for f in fields]
        return [
            f
            for f in fields
            if f.lstrip("-") in self.get_ordering_fields_lookups()
        ]
872102
def order_manually(sub_commands):
    """"""
    order = [
        "start",
        "projects",
    ]
    ordered = []
    commands = dict(zip([cmd for cmd in sub_commands], sub_commands))
    for k in order:
        ordered.append(commands.get(k, ""))
        if k in commands:
            del commands[k]

    # Add commands not present in `order` above
    for k in commands:
        ordered.append(commands[k])

    return ordered
528062
def ordered_dirs(self):
        
        return [item[0] for item in sorted(
            self.byte_contents.items(), key=lambda entry: entry[1].st_ino)]
804849
function optimizePluginsArray(plugins) {

        var prev;

        return plugins.reduce(function(plugins, item) {
            if (prev && item.type == prev[0].type) {
                prev.push(item);
            } else {
                plugins.push(prev = [item]);
            }
            return plugins;
        }, []);

    }