Sort all type LMS suffixes
18855
function(T, SA, C, B, n, k) {
        var b, i, j;
        var c0, c1;
        /* compute SAl */
        if (C === B) { getCounts(T, C, n, k); }
        getBuckets(C, B, k, false); /* find starts of buckets */
        j = n - 1;
        b = B[c1 = T[j]];
        j--;
        SA[b++] = (T[j] < c1) ? ~j : j;
        for (i = 0; i < n; i++) {
            if ((j = SA[i]) > 0) {
                ASSERT(T[j] >= T[j+1]);
                if ((c0 = T[j]) !== c1) { B[c1] = b; b = B[c1 = c0]; }
                ASSERT(i < b);
                j--;
                SA[b++] = (T[j] < c1) ? ~j : j;
                SA[i] = 0;
            } else if (j < 0) {
                SA[i] = ~j;
            }
        }
        /* compute SAs */
        if (C === B) { getCounts(T, C, n, k); }
        getBuckets(C, B, k, 1); /* find ends of buckets */
        for (i = n-1, b = B[c1 = 0]; i >= 0; i--) {
            if ((j = SA[i]) > 0) {
                ASSERT(T[j] <= T[j+1]);
                if ((c0 = T[j]) !== c1) { B[c1] = b; b = B[c1 = c0]; }
                ASSERT(b <= i);
                j--;
                SA[--b] = (T[j] > c1) ? ~(j+1) : j;
                SA[i] = 0;
            }
        }
    }
1333573
def sort_order(options = {})
      [[prefix, last].compact.join(' '), suffix, options[:initials] ? initials : first].compact.join(', ')
    end
656239
def _sort_text(definition):
    

    # If its 'hidden', put it next last
    prefix = 'z{}' if definition.name.startswith('_') else 'a{}'
    return prefix.format(definition.name)
160832
def strip_suffix(string, suffix, regex=False):
    """"""
    if not isinstance(string, six.string_types) or not isinstance(suffix, six.string_types):
        msg = 'Arguments to strip_suffix must be string types. Are: {s}, {p}'\
              .format(s=type(string), p=type(suffix))
        raise TypeError(msg)

    if not regex:
        suffix = re.escape(suffix)
    if not suffix.endswith('$'):
        suffix = '({s})$'.format(s=suffix)
    return _strip(string, suffix)
811003
def sort_prefixes(orig, prefixes='@+'):
    
    new = ''
    for prefix in prefixes:
        if prefix in orig:
            new += prefix
    return new
242495
public static function sortTerms($terms)
    {
        $sort_terms = array();
        foreach ($terms as $term) {
            $sort_terms[$term->name] = $term;
        }
        uksort($sort_terms, 'strnatcmp');

        return $sort_terms;
    }
674489
def display_list_by_prefix(names_list, starting_spaces=0):
  """"""
  cur_prefix, result_lines = None, []
  space = " " * starting_spaces
  for name in sorted(names_list):
    split = name.split("_", 1)
    prefix = split[0]
    if cur_prefix != prefix:
      result_lines.append(space + prefix + ":")
      cur_prefix = prefix
    result_lines.append(space + "  * " + name)
  return "\n".join(result_lines)
1206375
def _get_public_suffix_list():
    
    local_psl = os.environ.get('PUBLIC_SUFFIX_LIST')
    if local_psl:
        with codecs.open(local_psl, 'r', 'utf-8') as f:
            psl_raw = f.readlines()
    else:
        psl_raw = unicode(urlopen(PSL_URL).read(), 'utf-8').split('\n')
    psl = set()
    for line in psl_raw:
        item = line.strip()
        if item != '' and not item.startswith('//'):
            psl.add(item)
    return psl
534186
def get_suffixes(arr):
    
    arr = tuple(arr)
    return [arr]
    return (arr[i:] for i in range(len(arr)))
1291441
def _versioned_lib_suffix(env, suffix, version):
    """'"""
    Verbose = False
    if Verbose:
        print("_versioned_lib_suffix: suffix={:r}".format(suffix))
        print("_versioned_lib_suffix: version={:r}".format(version))
    if not suffix.endswith(version):
        suffix = suffix + '.' + version
    if Verbose:
        print("_versioned_lib_suffix: return suffix={:r}".format(suffix))
    return suffix
253350
def suffix(self):
        """"""
        name = self.name
        i = name.rfind('.')
        if 0 < i < len(name) - 1:
            return name[i:]
        else:
            return ''
956090
def get_suffix(name):
    
    a = name.count(".")
    if a:
        ext = name.split(".")[-1]
        if ext in LANGS.keys():
            return ext
        return False
    else:
        return False
342022
public static function filter_suffixed($array, $suffix, $remove_suffix = true)
    {
        $return = [];
        foreach ($array as $key => $val) {
            if (preg_match('/'.$suffix.'$/', $key)) {
                if ($remove_suffix === true) {
                    $key = preg_replace('/'.$suffix.'$/', '', $key);
                }
                $return[$key] = $val;
            }
        }
        return $return;
    }
4496
def subst_src_suffixes(self, env):
        
        memo_key = id(env)
        try:
            memo_dict = self._memo['subst_src_suffixes']
        except KeyError:
            memo_dict = {}
            self._memo['subst_src_suffixes'] = memo_dict
        else:
            try:
                return memo_dict[memo_key]
            except KeyError:
                pass
        suffixes = [env.subst(x) for x in self.src_suffix]
        memo_dict[memo_key] = suffixes
        return suffixes
849062
def remove_suffix(text, suffix):
	
	rest, suffix, null = text.partition(suffix)
	return rest
816085
function( term ) {
        var split_term = term.split(' ');
        var matchers = [];
        for (var i=0; i < split_term.length; i++) {
          if ( split_term[i].length > 0 ) {
            var matcher = {};
            matcher['partial'] = new RegExp( $.ui.autocomplete.escapeRegex( split_term[i] ), "i" );
            if ( context.settings['relevancy-sorting'] ) {
              matcher['strict'] = new RegExp( "^" + $.ui.autocomplete.escapeRegex( split_term[i] ), "i" );
            }
            matchers.push( matcher );
          }
        };

        return $.grep( context.options, function( option ) {
          var partial_matches = 0;
          if ( context.settings['relevancy-sorting'] ) {
            var strict_match = false;
            var split_option_matches = option.matches.split(' ');
          }
          for ( var i=0; i < matchers.length; i++ ) {
            if ( matchers[i]['partial'].test( option.matches ) ) {
              partial_matches++;
            }
            if ( context.settings['relevancy-sorting'] ) {
              for (var q=0; q < split_option_matches.length; q++) {
                if ( matchers[i]['strict'].test( split_option_matches[q] ) ) {
                  strict_match = true;
                  break;
                }
              };
            }
          };
          if ( context.settings['relevancy-sorting'] ) {
            var option_score = 0;
            option_score += partial_matches * context.settings['relevancy-sorting-partial-match-value'];
            if ( strict_match ) {
              option_score += context.settings['relevancy-sorting-strict-match-value'];
            }
            option_score = option_score * option['relevancy-score-booster'];
            option['relevancy-score'] = option_score;
          }
          return (!term || matchers.length === partial_matches );
        });
      }
643244
function(match, shortNames, longNames) {
			var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
				return [ [k, v] ];
			}).sort(function (a, b) {
				return -(a[1].length - b[1].length);
			});
			var index = -1;
			$.each(names, function (i, pair) {
				var name = pair[1];
				if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) {
					index = pair[0];
					iValue += name.length;
					return false;
				}
			});
			if (index != -1)
				return index + 1;
			else
				throw 'Unknown name at position ' + iValue;
		}