Sorts the keys and members
430277
def sort_common_members():
    """"""

    filename = PREFIX + '/common_members.json'
    sorted_json_data = {}
    json_data = read_json(filename)

    all_keys = []
    for key, value in json_data.items():
        all_keys.append(key)
    sorted_keys = sorted(all_keys)

    for key in sorted_keys:
        if len(json_data[key]) > 0:
            # Only add modules which have common members
            sorted_json_data[key] = sorted(json_data[key])

    print('--> Sorted/cleaned ' + os.path.basename(filename))

    write_json(sorted_json_data, filename)
921531
def nsorted(to_sort, key=None):
    """"""
    if key is None:
        key_callback = _natural_keys
    else:
        def key_callback(item):
            return _natural_keys(key(item))

    return sorted(to_sort, key=key_callback)
636740
function _sortPropertyContainers(obj, key) {
        if (_smellsLikeAPropertyContainer(obj)) {
            return _.mapValues(obj, _sortElements);
        }
        else {
            return obj;
        }
    }
1329081
def file_sort(my_list):
    

    def alphanum_key(key):
        """
        Split the key into str/int parts
        """
        return [int(s) if s.isdigit() else s for s in re.split("([0-9]+)", key)]

    my_list.sort(key=alphanum_key)
    return my_list
1119828
function SortedSet(source) {
  HashMap.call(this);
  this._rtype = TYPE_NAMES.ZSET;
  if(source) {
    for(var k in source) {
      this.setKey(k, source[k]);
    }
  }
}
1221143
def sorted(self, key=None, reverse=False):
        
        return self._transform(transformations.sorted_t(key=key, reverse=reverse))
81844
function arraySortByKey(data, key, reverse) {
    data.sort((a, b) => {
        const aw = a[key] !== undefined ? (
            typeof a[key] === 'function' ?
            parseInt(a[key](), 10) :
            parseInt(a[key], 10)
        ) : 0;
        const bw = b[key] !== undefined ? (
            typeof b[key] === 'function' ?
            parseInt(b[key](), 10) :
            parseInt(b[key], 10)
        ) : 0;

        if (aw === bw) {
            return 0;
        }

        return reverse !== true && aw < bw ? -1 : 1;
    });
}
1118983
private static Sort getSort(String... columnNames) {
        Sort key = null;
        for (String s : columnNames) {
            if (key == null) {
                key = first(s, Sort.Order.DESCEND);
            } else {
                key.next(s, Sort.Order.DESCEND);
            }
        }
        return key;
    }
253093
def nsorted(
    to_sort: Iterable[str],
    key: Optional[Callable[[str], Any]] = None
) -> List[str]:
    """"""
    if key is None:
        key_callback = _natural_keys
    else:
        def key_callback(text: str) -> List[Any]:
            return _natural_keys(key(text))  # type: ignore

    return sorted(to_sort, key=key_callback)
500780
def keys(self):
        
        k = list(dict.keys(self))
        k.sort()
        return k
863591
static function sortByExternalKeys($dataArray, $keysArray) {
		$returnArray = array();
		foreach($keysArray as $k) {
			if (isset($dataArray[$k])) {
				$returnArray[$k] = $dataArray[$k];
			} else {
				$returnArray[$k] = null;
			}
		}
		return $returnArray;
	}
830550
function objectSortByKey(data, key, reverse) {
    let keys = Object.keys(data);
    keys.sort((a, b) => {
        const aw = data[a][key] !== undefined ? parseInt(data[a][key], 10) : 0;
        const bw = data[b][key] !== undefined ? parseInt(data[b][key], 10) : 0;
        if (aw === bw) {
            return 0;
        }

        return reverse !== true && aw < bw ? -1 : 1;
    });

    keys.forEach((key) => {
        const value = data[key];
        delete data[key];
        data[key] = value;
    });
}
101420
function getSortedKeys(obj) {
  var keys = [];
  $.each(obj, function(key, value) {
    keys.push(key);
  });
  keys.sort();
  return keys;
}
570491
def sort_key(val):
    """"""
    return numpy.sum((max(val)+1)**numpy.arange(len(val)-1, -1, -1)*val)
1265321
function sortKey(bool $descending = false, int $options = \SORT_REGULAR) {
        $data = $this->data;
        
        if($descending) {
            \krsort($data, $options);
        } else {
            \ksort($data, $options);
        }
        
        return (new self($data));
    }
153462
def sort_by_key(self, keys=None):
        
        keys = keys or self.key_on
        keys = keys if isinstance(keys, (list, tuple)) else [keys]
        for key in reversed(keys):
            reverse, key = (True, key[1:]) if key[0] == '-' else (False, key)
            self.table.sort(key=lambda row: row[key], reverse=reverse)
1333573
def sort_order(options = {})
      [[prefix, last].compact.join(' '), suffix, options[:initials] ? initials : first].compact.join(', ')
    end