ordered according to http://cr.openjdk.java.net/~alundblad/styleguide/index-v6.html
765871
public static String stringify(Set<Modifier> modifiers) {
        return modifiers.stream()
                .sorted(Comparator.comparingInt(ModifierChanged::score))
                .map(m -> m.name().toLowerCase())
                .collect(Collectors.joining(" "));
    }
893915
def order_by( filter, *fields, label: fields.first.to_s.titleize, order_link_class: default_order_link_class )
      return label if filter.nil?

      # current ordering from the filter
      # each expr is a Sequel::SQL::Expression
      exprs = Hash[ filter.order_expressions ]

      # Invert each ordering for the generated link. Current sort order will be displayed.
      order_links = fields.map do |field|
        if exprs[field]
          order_link_class.new exprs[field].invert, active: true
        else
          order_link_class.new Sequel.asc(field)
        end
      end

      # filter params must have order in the right format
      filter_params = filter.filter_parameters.dup
      filter_params[:order] = unify_array( order_links.map( &:name ) )

      params_hash = {filter.class::Model.model_name.param_key.to_sym => filter_params}
      link_text = raw( [label, order_links.first.andand.icon].compact.join(' ') )
      link_to link_text, params_hash, {class: order_links.first.andand.css_class}
    end
1220514
@Override
   public Section getIndex(String title, int nesting, List<? extends BaseStyler> stylers) throws VectorPrintException, InstantiationException, IllegalAccessException {
      if (nesting < 1) {
         throw new VectorPrintException("chapter numbering starts with 1, wrong number: " + nesting);
      }
      if (sections.get(nesting) == null) {
         sections.put(nesting, new ArrayList<>(10));
      }
      Section current;
      if (nesting == 1) {
         List<Section> chapters = sections.get(1);
         current = new Chapter(createElement(title, Paragraph.class, stylers), chapters.size() + 1);
         chapters.add(current);
      } else {
         List<Section> parents = sections.get(nesting - 1);
         Section parent = parents.get(parents.size() - 1);
         current = parent.addSection(createParagraph(title, stylers));
         sections.get(nesting).add(current);
      }
      return styleHelper.style(current, null, stylers);
   }
335498
function sortCssDecls (cssDecls, sortOrder) {
  if (sortOrder === 'alphabetically') {
    timsort(cssDecls, (a, b) => {
      if (a.type === 'decl' && b.type === 'decl') {
        return comparator(a.prop, b.prop);
      } else {
        return compareDifferentType(a, b);
      }
    });
  } else {
    timsort(cssDecls, (a, b) => {
      if (a.type === 'decl' && b.type === 'decl') {
        const aIndex = sortOrder.indexOf(a.prop);
        const bIndex = sortOrder.indexOf(b.prop);
        return comparator(aIndex, bIndex);
      } else {
        return compareDifferentType(a, b);
      }
    });
  }
}
133361
function reorderAnnotationsByType(documentId, pageNumber, type) {
  PDFJSAnnotate.getStoreAdapter().getAnnotations(documentId, pageNumber)
    .then((annotations) => {
      return annotations.annotations.filter((a) => {
        return a.type === type;
      });
    })
    .then((annotations) => {
      annotations.forEach((a) => {
        removeAnnotation(documentId, a.uuid);
      });

      return annotations;
    })
    .then(renderScreenReaderHints);
}
654293
def get_ordering(self, *args, **kwargs):
        """"""
        result = super(SequenceCursorPagination, self).get_ordering(*args, **kwargs)

        # Because paginate_queryset sets self.ordering after reading it...we
        # need to only modify it sometimes. (This allows re-use of the
        # paginator, which probably only happens in tests.)
        if result[0] != '#':
            result = ('#', ) + result

        return result
393839
public function orderIndexes() {
        $result = $this->orderElements($this->indexes);
        if ($result) {
            $this->setIndexes($result);
            return true;
        } else {
            return false;
        }
    }
985284
private int[] getStyle(int index) {
        if (m_styleOffsets==null || m_styles==null ||
                index>=m_styleOffsets.length)
        {
            return null;
        }
        int offset=m_styleOffsets[index]/4;
        int style[];
        {
            int count=0;
            for (int i=offset;i<m_styles.length;++i) {
                if (m_styles[i]==-1) {
                    break;
                }
                count+=1;
            }
            if (count==0 || (count%3)!=0) {
                return null;
            }
            style=new int[count];
        }
        for (int i=offset,j=0;i<m_styles.length;) {
            if (m_styles[i]==-1) {
                break;
            }
            style[j++]=m_styles[i++];
        }
        return style;
    }
1160798
function orderBy (arr) {
  var comparator = null
  var sortKeys
  arr = util.convertArray(arr)

  // determine order (last argument)
  var args = util.toArray(arguments, 1)
  var order = args[args.length - 1]
  if (typeof order === 'number') {
    order = order < 0 ? -1 : 1
    args = args.length > 1 ? args.slice(0, -1) : args
  } else {
    order = 1
  }

  // determine sortKeys & comparator
  var firstArg = args[0]
  if (!firstArg) {
    return arr
  } else if (typeof firstArg === 'function') {
    // custom comparator
    comparator = function (a, b) {
      return firstArg(a, b) * order
    }
  } else {
    // string keys. flatten first
    sortKeys = Array.prototype.concat.apply([], args)
    comparator = function (a, b, i) {
      i = i || 0
      return i >= sortKeys.length - 1
        ? baseCompare(a, b, i)
        : baseCompare(a, b, i) || comparator(a, b, i + 1)
    }
  }

  function baseCompare (a, b, sortKeyIndex) {
    var sortKey = sortKeys[sortKeyIndex]
    if (sortKey) {
      if (sortKey !== '$key') {
        if (util.isObject(a) && '$value' in a) a = a.$value
        if (util.isObject(b) && '$value' in b) b = b.$value
      }
      a = util.isObject(a) ? util.getPath(a, sortKey) : a
      b = util.isObject(b) ? util.getPath(b, sortKey) : b
    }
    return a === b ? 0 : a > b ? order : -order
  }

  // sort on a copy to avoid mutating original array
  return arr.slice().sort(comparator)
}
986137
private String getOrderByColumn(String[] orderByColumns, Attribute column)
    {

        if (orderByColumns != null)
        {
            for (String orderColumn : orderByColumns)
            {
                String[] orderValue = orderColumn.split("\\s");
                String orderColumnName = orderValue[0].substring(orderValue[0].lastIndexOf('.') + 1);
                String orderColumnValue = orderValue[1];

                if (orderColumnName.equals(((AbstractAttribute) column).getName())
                        || orderColumnName.equals(((AbstractAttribute) column).getJPAColumnName()))
                {
                    return orderColumnValue;
                }
            }
        }
        return null;

    }
959096
public List<E> order() {
		int index = 0;
		for (E item : input) {
			index = output.indexOf(item);
			if (index == -1) {
				insert(item, item);
			}
		}

		return output;
	}
224977
function LineNumberCompareRuler (diffNavigator, mapperColumnIndex , annoModel, rulerLocation, rulerStyle, oddStyle, evenStyle) {
		orion.CompareRuler.call(this, annoModel, rulerLocation, "page", rulerStyle); //$NON-NLS-0$
		this._diffNavigator = diffNavigator;
		this._oddStyle = oddStyle || {style: {backgroundColor: "white"}}; //$NON-NLS-0$
		this._evenStyle = evenStyle || {style: {backgroundColor: "white"}}; //$NON-NLS-0$
		this._numOfDigits = 0;
		this._mapperColumnIndex = mapperColumnIndex;
	}
928578
public static String orderBy(List<OrderByArg> argsList) {
		OrderByArg[] args;
		if (argsList == null) {
			args = null;
		} else {
			args = argsList.toArray(new OrderByArg[argsList.size()]);
		}
		return orderBy(args);
	}
395815
@Override
    public boolean isOrderDeterministic() {
        if ( ! hasTopLevelScans()) {
            // This currently applies to parent queries that do all their
            // scanning in subqueries and so take on the order determinism of
            // their subqueries. This might have to be rethought to allow
            // ordering in parent queries to effect determinism of unordered
            // "FROM CLAUSE" subquery results.
            return true;
        }

        if (hasAOneRowResult()) {
            return true;
        }

        if ( ! hasOrderByColumns() ) {
            return false;
        }

        // The nonOrdered expression list is used as a short-cut
        // -- if an expression has been determined to be
        // non-ordered when encountered as a GROUP BY expression,
        // it will also be non-ordered when encountered in the select list.
        ArrayList<AbstractExpression> nonOrdered = new ArrayList<>();

        if (isGrouped()) {
            // Does the ordering of a statements's GROUP BY columns
            // ensure determinism?
            // All display columns and order-by expressions
            // are functionally dependent on the GROUP BY
            // columns even if the display column's values
            // are not ordered or unique,
            // so ordering by ALL of the GROUP BY columns is enough
            // to get full determinism,
            // EVEN if ordering by other (dependent) expressions,
            // regardless of the placement of non-GROUP BY expressions
            // in the ORDER BY list.
            if (orderByColumnsDetermineAllColumns(m_groupByColumns, nonOrdered)) {
                return true;
            }

            if (orderByColumnsDetermineAllDisplayColumns(nonOrdered)) {
                return true;
            }

        }
        else {
            if (orderByColumnsDetermineAllDisplayColumns(nonOrdered)) {
                return true;
            }

            if (orderByColumnsCoverUniqueKeys()) {
                return true;
            }
        }
        return false;
    }
863921
private String getOrdinal(Integer value)
   {
      String result;
      int index = value.intValue();
      if (index >= ORDINAL.length)
      {
         result = "every " + index + "th";
      }
      else
      {
         result = ORDINAL[index];
      }
      return result;
   }
174040
def get_zorder(self, overlay, key, el):
        
        spec = util.get_overlay_spec(overlay, key, el)
        return self.ordering.index(spec)
955482
private static List<ClasspathElement> orderClasspathElements(
            final Collection<Entry<Integer, ClasspathElement>> classpathEltsIndexed) {
        final List<Entry<Integer, ClasspathElement>> classpathEltsIndexedOrdered = new ArrayList<>(
                classpathEltsIndexed);
        CollectionUtils.sortIfNotEmpty(classpathEltsIndexedOrdered, INDEXED_CLASSPATH_ELEMENT_COMPARATOR);
        final List<ClasspathElement> classpathEltsOrdered = new ArrayList<>(classpathEltsIndexedOrdered.size());
        for (final Entry<Integer, ClasspathElement> ent : classpathEltsIndexedOrdered) {
            classpathEltsOrdered.add(ent.getValue());
        }
        return classpathEltsOrdered;
    }