Returns a sorted patterns list, ordered descending by start length
165518
function getPatterns() {
        if (isPatternsDirty) {
          patterns.sort(function (a, b) {
            if (a.start.length > b.start.length) {
              return -1;
            }

            if (a.start.length < b.start.length) {
              return 1;
            }

            return 0;
          });

          isPatternsDirty = false;
        }

        return patterns;
      }
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()
        ]
633733
def sorted_query_paths(self):
        
        return list(reversed(sorted(p[0] for p in self.namespace.alias_to_query_paths.get(self.name))))
1092204
def orderered_methods(self):
        

        oms = []

        self.methods.reverse()

        if self.main:
            oms = [self.main]

        for m in self.methods:

            if m == self.main:
                continue
            oms.append(m)

        return oms
1078942
def get_ordered_attributes(self):
        
        attrs = self.get_attributes()
        attr_arr = np.array(attrs)
        poss = [self.chrPos, self.startPos, self.stopPos]
        if self.strandPos is not None:
            poss.append(self.strandPos)
        if self.otherPos:
            for o in self.otherPos:
                poss.append(o[0])

        idx_sort = np.array(poss).argsort()
        return attr_arr[idx_sort].tolist()
375295
def bottoms(panels):
    
    bottom_lines = [(p['col'], p['row'] + p['size_y'], p['col'] + p['size_x'], p['row'] + p['size_y']) for p in panels]
    return sorted(bottom_lines, key=lambda l: l[1], reverse=True)
1043601
def _map_order_to_ticks(start, end, order, reverse=False):
        
        size = len(order)
        bounds = np.linspace(start, end, size + 1)
        if reverse:
            bounds = bounds[::-1]
        mapping = list(zip(bounds[:-1]%(np.pi*2), order))
        return mapping
527106
def sort_list(items):
    """"""

    # Track by number of words.
    track = {}

    def by_length(word1, word2):
        return len(word2) - len(word1)

    # Loop through each item.
    for item in items:
        # Count the words.
        cword = utils.word_count(item, all=True)
        if cword not in track:
            track[cword] = []
        track[cword].append(item)

    # Sort them.
    output = []
    for count in sorted(track.keys(), reverse=True):
        sort = sorted(track[count], key=len, reverse=True)
        output.extend(sort)

    return output
383453
private List<String> getPatterns(List<NumberPattern> patterns) {
    return patterns.stream()
        .map(p -> p.render())
        .collect(Collectors.toList());
  }
1113394
def unrank(n, sequence=string.ascii_lowercase):
    
    return list(map(sequence.__getitem__, indexes(n)))
528062
def ordered_dirs(self):
        
        return [item[0] for item in sorted(
            self.byte_contents.items(), key=lambda entry: entry[1].st_ino)]
213804
def GetPattern(self):
    """"""
    stoptimes = self.GetStopTimes()
    return tuple(st.stop for st in stoptimes)
519226
def sorted_source_files(self):
        """"""

        assert self.final, 'Call build() before using the graph.'
        out = []
        for node in nx.topological_sort(self.graph):
            if isinstance(node, NodeSet):
                out.append(node.nodes)
            else:
                # add a one-element list for uniformity
                out.append([node])
        return list(reversed(out))
188689
def _sortObjects(orderby='created', **kwargs):
    """"""
    o = []
    
    for m in kwargs.values():
        for l in iter(m):
            o.append(l)
    o = list(set(o))
    sortfunc = _sortByCreated if orderby == 'created' else _sortByModified
    if six.PY2:
        o.sort(sortfunc)
    else:
        o.sort(key=functools.cmp_to_key(sortfunc))

    return o
618628
def get_sorted_tags(self, pattern):
        
        matcher = re.compile(pattern)
        tags = []
        for tag in self.get_repo().git.tag().split('\n'):
            m = matcher.match(tag)
            if m:
                numbers = []
                for k, v in m.groupdict().items():
                    if k.startswith('cmp'):
                        numbers.append((int(k[3:]), int(v)))
                numbers.sort()

                tags.append((tag, numbers))
        return map(lambda t: t[0], sorted(tags, key=lambda t: t[1], reverse=True))
437227
def parse_pattern_list(liststr):
    """"""
    _re_patt = re.compile("^(.*)=(.*)")
    patterns = []
    for ss in liststr.split(';'):
        match = _re_patt.match(ss)
        if match:
            desc = match.group(1)
            patt = match.group(2).split(',')
            patterns.append((desc, patt))
    return patterns
929262
def sort_by_length(self):
        
        self.lengths, indices = self.lengths.sort(descending=True)

        self.src = [self.src[idx] for idx in indices]
        self.tgt = [self.tgt[idx] for idx in indices]
        self.src_lengths = [self.src_lengths[idx] for idx in indices]
        self.tgt_lengths = [self.tgt_lengths[idx] for idx in indices]
        self.indices = indices.tolist()
        self.sorted = True