Sort the object's values by a criterion produced by an iterator.
162946
def sortBy(self, val=None):
        
        if val is not None:
            if _(val).isString():
                return self._wrap(sorted(self.obj, key=lambda x,
                                  *args: x.get(val)))
            else:
                return self._wrap(sorted(self.obj, key=val))
        else:
            return self._wrap(sorted(self.obj))
184775
def sorted(collection):
        
        if len(collection) < 1:
            return collection

        if isinstance(collection, dict):
            return sorted(collection.items(), key=lambda x: x[0])

        if isinstance(list(collection)[0], Operation):
            key = lambda x: x.operation_id
        elif isinstance(list(collection)[0], str):
            key = lambda x: SchemaObjects.get(x).name
        else:
            raise TypeError(type(collection[0]))
        return sorted(collection, key=key)
844137
def sort_values(self, by, axis=0, ascending=True,
                    kind='quicksort', na_position='last'):
        
        return self._frame.sort_values(by, axis=axis, ascending=ascending,
                                       inplace=False, kind=kind,
                                       na_position=na_position)
633775
def sort_values(self, return_indexer=False, ascending=True):
        
        if return_indexer:
            _as = self.argsort()
            if not ascending:
                _as = _as[::-1]
            sorted_index = self.take(_as)
            return sorted_index, _as
        else:
            sorted_values = np.sort(self._ndarray_values)
            attribs = self._get_attributes_dict()
            freq = attribs['freq']

            if freq is not None and not is_period_dtype(self):
                if freq.n > 0 and not ascending:
                    freq = freq * -1
                elif freq.n < 0 and ascending:
                    freq = freq * -1
            attribs['freq'] = freq

            if not ascending:
                sorted_values = sorted_values[::-1]

            return self._simple_new(sorted_values, **attribs)
698922
public static <T> T[] sort(T[] self, Comparator<T> comparator) {
        return sort(self, true, comparator);
    }
123960
def sort(self, values):
        """"""
        for level in self:
            for wire1, wire2 in level:
                if values[wire1] > values[wire2]:
                    values[wire1], values[wire2] = values[wire2], values[wire1]
404720
def iteritems_sorted(dict_):
    
    if isinstance(dict_, OrderedDict):
        return six.iteritems(dict_)
    else:
        return iter(sorted(six.iteritems(dict_)))
804783
def itervalues(obj):
    ""
    return iter(obj.values()) if sys.version_info.major == 3 else obj.itervalues()
559169
private Iterator getValuesIterator(Object value) {

        if (value instanceof Collection) {
            return ((Collection) value).iterator();
        } else {
            return (new ArrayIterator(value));
        }

    }
1300022
function sort(object) {
    if (sortArrays === true && Array.isArray(object)) {
      return object.sort();
    } else if (typeof object !== "object" || object === null) {
      return object;
    }

    return Object.keys(object).sort().map(function(key) {
      return {
        key: key,
        value: sort(object[key])
      };
    });
  }
192306
public static void sort(int[] intArray) {
        int index = 0;
        int value = 0;
        
        for(int i = 1; i < intArray.length; i++) {
            index = i;
            value = intArray[index];
            

            while(index > 0 && value < intArray[index - 1]) {
                intArray[index] = intArray[index - 1];
                
                index--;
            }
            
            intArray[index] = value;
        }
    }
1218093
def sort_collection_by_column(collection, column, order)
      sorter = column.sort[:method]
      collection = collection.sort_by do |record|
        value = sorter.is_a?(Proc) ? record.instance_eval(&sorter) : record.instance_eval(sorter.to_s)
        value = '' if value.nil?
        value
      end
      collection.reverse! if order.casecmp('DESC').zero?
      collection
    end
1314626
private static <T> ArrayList<T> sorted(Collection<T> cls, Comparator<? super T> c) {
    ArrayList<T> sorted = new ArrayList<>(cls);
    sorted.sort(c);
    return sorted;
  }
832735
public void sort(@NonNull Comparator<? super T> comparator) {
        final ArrayList<T> copy = new ArrayList<>(mObjects);
        Collections.sort(copy, comparator);
        swap(copy);
    }
482530
def iter_(obj):
    
    if six.PY2:
        file_types = file,  # noqa
    if six.PY3:
        file_types = io.IOBase,
        dict_items = {}.items().__class__
        dict_values = {}.values().__class__
        dict_keys = {}.keys().__class__
        dict_view = (dict_items, dict_values, dict_keys)

    if isinstance(obj, dict):
        return ordered_sequence_iterator(list(obj.keys()))
    if isinstance(obj, file_types):
        return file_iterator(obj)
    if six.PY2:
        if isinstance(obj, (list, tuple)):
            return ordered_sequence_iterator(obj)
        if isinstance(obj, xrange):  # noqa
            return range_iterator(obj)
        if NUMPY_AVAILABLE and isinstance(obj, numpy.ndarray):
            return ordered_sequence_iterator(obj)
    if six.PY3 and isinstance(obj, dict_view):
        return ordered_sequence_iterator(list(obj))
    return iter(obj)
968207
public static <T> List<T> sort(Collection<T> collection, Comparator<? super T> comparator) {
		List<T> list = new ArrayList<T>(collection);
		Collections.sort(list, comparator);
		return list;
	}
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)