Convert strings like cmd into symbols like ⌘
@param  {String} combo Key combination, e.g. 'mod+f'
@return {String}       The key combination with symbols
495409
function symbolize (combo) {
        var map = {
          command   : '\u2318',     // ⌘
          shift     : '\u21E7',     // ⇧
          left      : '\u2190',     // ←
          right     : '\u2192',     // →
          up        : '\u2191',     // ↑
          down      : '\u2193',     // ↓
          'return'  : '\u23CE',     // ⏎
          backspace : '\u232B'      // ⌫
        };
        combo = combo.split('+');

        for (var i = 0; i < combo.length; i++) {
          // try to resolve command / ctrl based on OS:
          if (combo[i] === 'mod') {
            if ($window.navigator && $window.navigator.platform.indexOf('Mac') >=0 ) {
              combo[i] = 'command';
            } else {
              combo[i] = 'ctrl';
            }
          }

          combo[i] = map[combo[i]] || combo[i];
        }

        return combo.join(' + ');
      }
797819
function parseKeyString(str) {
      var key, match;
      var keys = [];
      while (str) {
        match = (/<\w+-.+?>|<\w+>|./).exec(str);
        if(match === null)break;
        key = match[0];
        str = str.substring(match.index + key.length);
        keys.push(key);
      }
      return keys;
    }
481103
function(string, color) {
      return "\u001B[" + {
       bold    : 1,
       black   : 30,
       red     : 31,
       green   : 32,
       yellow  : 33,
       blue    : 34,
       magenta : 35,
       cyan    : 36,
       white   : 37
      }[color] + 'm' + string + "\u001B[0m"
    }
811889
function compileKeys(urls) {
    return urls.map(function (url) {
        // replace named params with regexp groups
        var pattern = url[0].replace(/\/:\w+/g, '(?:/([^\/]+))');
        url[0] = new RegExp('^(?:' + pattern + ')$');
        return url;
    });
}
866918
function(k) {
      var $combo = this['$'+k];
      if (!$combo) {
        return;
      }

      // define method name to fill items, e.g `fillDays`
      var f = 'fill' + k.charAt(0).toUpperCase() + k.slice(1); 
      var items = this[f]();
      var value = $combo.val();

      $combo.html('');
      for(var i=0; i<items.length; i++) {
        $combo.append('<option value="'+items[i][0]+'">'+items[i][1]+'</option>');
      }

      $combo.val(value);
    }
260279
function parse(content, comboMapFile, o) {
	CONTENT = '';
	var source_content = content;
	JS_Files = [];
	CSS_Files = [];
	comboCSS = true;
	comboJS = true;
	content = css(content);
	content = js(content);
	if (comboMapFile) {
		JS_Files = insertComboMapFile(JS_Files, comboMapFile);
	}

	try {
		JS_Files = teardownParams(JS_Files);
		CSS_Files = teardownParams(CSS_Files);
	} catch(e){}

	var combinedJS = getCombinedAssets(JS_Files);
	var combinedCSS = getCombinedAssets(CSS_Files);


	return {
		content: insertScript(recall(content), combinedJS, combinedCSS),
		js: distinct(JS_Files),
		css: distinct(CSS_Files)
	};
}
444585
def _get_string_and_set_width(self, combination, mode):
        
        show = "{}".format(self._separator(mode)).join(combination)
        show = show.rstrip("{}".format(self._separator(mode)))
        self.max_width = max([self.max_width, len(show)])
        return show
1294809
function parseNameVal(cmd) {
    // This is kind of tricky because we need to support the old
    // variant:   KEY name value
    // as well as the new one:    KEY name=value ...
    // The trigger to know which one is being used will be whether we hit
    // a space or = first.  space ==> old, "=" ==> new
    var word;
    var words = parseWords(cmd.rest);

    cmd.args = {};

    if (words.length === 0) {
        cmd.error = 'No KEY name value, or KEY name=value arguments found';
        return false;
    }

    if (words[0].indexOf('=') == -1) {
        // Old format (KEY name value)
        var strs = cmd.rest.split(TOKEN_WHITESPACE);
        if (strs.length < 2) {
            cmd.error = cmd.name + ' must have two arguments, got ' + cmd.rest;
            return false;
        }

        // Convert to new style key:value map.
        cmd.args[strs[0]] = strs.slice(1).join(' ');

    } else {
        // New format (KEY name=value ...)
        var i;
        for (i = 0; i < words.length; i++) {
            word = words[i];
            if (word.indexOf('=') == -1) {
                cmd.error = 'Syntax error - can\'t find = in ' + word + '. Must be of the form: name=value';
                return false;
            }
            var parts = word.split('=');
            cmd.args[parts[0]] = parts.slice(1).join('=');
        }
    }

    return true;
}
1176814
function () {
            var me = this, shortcutkeys = this.shortcutkeys;
            me.addListener('keydown', function (type, e) {
                var keyCode = e.keyCode || e.which;
                for (var i in shortcutkeys) {
                    var tmp = shortcutkeys[i].split(',');
                    for (var t = 0, ti; ti = tmp[t++];) {
                        ti = ti.split(':');
                        var key = ti[0], param = ti[1];
                        if (/^(ctrl)(\+shift)?\+(\d+)$/.test(key.toLowerCase()) || /^(\d+)$/.test(key)) {
                            if (( (RegExp.$1 == 'ctrl' ? (e.ctrlKey || e.metaKey) : 0)
                                && (RegExp.$2 != "" ? e[RegExp.$2.slice(1) + "Key"] : 1)
                                && keyCode == RegExp.$3
                                ) ||
                                keyCode == RegExp.$1
                                ) {
                                if (me.queryCommandState(i,param) != -1)
                                    me.execCommand(i, param);
                                domUtils.preventDefault(e);
                            }
                        }
                    }

                }
            });
        }
408268
function styleStringify (obj) {
  var key;
  var keyCount = 0;
  var i = 0;
  var str = '';

  for (key in obj) { keyCount++; }

  for (key in obj) {
    str += (key + ': ' + obj[key]);
    if (i < keyCount - 1) { str += '; '; }
    i++;
  }
  return str;
}
828190
function encodePubModes(modes) {
	var string = "";
	if(modes.raw) {
		string = string + modeValues.RAW;
	};
	if(modes.merge) {
		string = string + modeValues.MERGE;
	};
	if(modes.distinct) {
		string = string + modeValues.DISTINCT;
	};
	if(modes.command) {
		string = string + modeValues.COMMAND;
	};
	if (!string) {
		throw new Error("No modes are specified");
	}
	return string;
}
1203329
def parse_combo(self, combo, modes_set, modifiers_set, pfx):
        
        mode, mods, trigger = None, set([]), combo
        if '+' in combo:
            if combo.endswith('+'):
                # special case: probably contains the keystroke '+'
                trigger, combo = '+', combo[:-1]
                if '+' in combo:
                    items = set(combo.split('+'))
                else:
                    items = set(combo)
            else:
                # trigger is always specified last
                items = combo.split('+')
                trigger, items = items[-1], set(items[:-1])

            if '*' in items:
                items.remove('*')
                # modifier wildcard
                mods = '*'
            else:
                mods = items.intersection(modifiers_set)

            mode = items.intersection(modes_set)
            if len(mode) == 0:
                mode = None
            else:
                mode = mode.pop()

        if pfx is not None:
            trigger = pfx + trigger

        return (mode, mods, trigger)
738919
function mixkey(seed, key) {
  var stringseed = seed + '', smear, j = 0;
  while (j < stringseed.length) {
    key[mask & j] =
      mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));
  }
  return tostring(key);
}
1014332
function cmd(patterns, options) {
  var str = normalize(patterns);
  var keys = Object.keys(options);
  var args = [];
  var valid = [
    'dotglob',
    'extglob',
    'failglob',
    'globstar',
    'nocaseglob',
    'nullglob'
  ];

  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    if (valid.indexOf(key) !== -1) {
      args.push('-O', key);
    }
  }

  args.push('-c', 'for i in ' + str + '; do echo $i; done');
  return args;
}
92449
String concatIconTitles(String main, String secondary) {

        if (main == null) {
            main = "";
        }
        if (secondary == null) {
            secondary = "";
        }

        if (secondary.length() == 0) {
            return main;
        }
        return main + " [" + secondary + "]";

    }
18967
function reverse(combos) {
  const { offsuit, suited, pairs } = sortOut(combos)

  const ps = reversePairs(pairs)
  const os = reverseNonPairs(offsuit, 'o')
  const su = reverseNonPairs(suited, 's')
  const nonpairs = unsuitWhenPossible(new Set(os), new Set(su))

  return ps.concat(nonpairs).join(', ')
}
343821
function getSymbols(string) {
  var length = string.length;
  var index = -1;
  var output = [];
  var character;
  var charCode;
  while (++index < length) {
    character = string.charAt(index);
    charCode = character.charCodeAt(0);
    if (charCode >= 0xaa && charCode <= 0xDBFF) {
      // Note: this doesn’t account for lone high surrogates;
      // you’d need even more code for that!
      output.push(character + string.charAt(++index));
    } else { 
      output.push(character);
    }
  }
  return output;
}