View Hitman internal settings. Use 'all' for all keys
960690
def get_settings(all,key):
    """"""
    with Database("settings") as s:
        if all:
            for k, v in zip(list(s.keys()), list(s.values())):
                print("{} = {}".format(k, v))
        elif key:
            print("{} = {}".format(key, s[key]))
        else:
            print("Don't know what you want? Try --all")
876878
def accept_all(self):
        '''
        
        '''
        keys = self.list_keys()
        for key in keys[self.PEND]:
            try:
                shutil.move(
                        os.path.join(
                            self.opts['pki_dir'],
                            self.PEND,
                            key),
                        os.path.join(
                            self.opts['pki_dir'],
                            self.ACC,
                            key)
                        )
                eload = {'result': True,
                         'act': 'accept',
                         'id': key}
                self.event.fire_event(eload,
                                      salt.utils.event.tagify(prefix='key'))
            except (IOError, OSError):
                pass
        return self.list_keys()
528209
function enableAll(win) {
	debug(`Enabling all shortcuts on window ${title(win)}`);
	const wc = win.webContents;
	const shortcutsOfWindow = windowsWithShortcuts.get(wc);

	for (const shortcut of shortcutsOfWindow) {
		shortcut.enabled = true;
	}
}
113986
def directory():
    """"""
    home = os.path.expanduser('~')
    if platform.system() == 'Linux':
        hitman_dir = os.path.join(home, '.hitman')
    elif platform.system() == 'Darwin':
        hitman_dir = os.path.join(home, 'Library', 'Application Support',
                                  'hitman')
    elif platform.system() == 'Windows':
        hitman_dir = os.path.join(os.environ['appdata'], 'hitman')
    else:
        hitman_dir = os.path.join(home, '.hitman')
    if not os.path.isdir(hitman_dir):
        os.mkdir(hitman_dir)
    return hitman_dir
688974
def by_name(self):
        """"""
        return {key.split(preferences_settings.SECTION_KEY_SEPARATOR)[-1]: value for key, value in self.all().items()}
377
def inspect
      ['{config', *each.map{|key, value| " "+qualified_key(*key)+" => "+value.inspect },'}'].join("\n")
    end
133936
def all_settings(self, uppercase_keys=False):
        """"""
        d = {}

        for k in self.all_keys(uppercase_keys):
            d[k] = self.get(k)

        return d
655376
function getMappedKey (key, create) {
        allKeyMap = getAllKeys();

        if (create && !(key in allKeyMap)) {
            var newKey = ("uD" + _UNIQUE_ID++);
            setMappedKey(newKey, key);

            return newKey;
        } else {
            return allKeyMap[key];
        }
    }
62005
def all(options={}, cmd_options={})
      cmd = command_with_limit(["log --style ?", style], options[:limit])

      hg_to_array(cmd, {:separator => changeset_separator}, cmd_options) do |line|
        build(line)
      end
    end
646006
def updateAllKeys(self):
        """"""
        for kf, key in zip(self.kf_list, self.sorted_key_list()):
            kf.update(key, self.dct[key])
470550
function assignKey(key, scope, method){
    var keys, mods, i, mi;
    if (method === undefined) {
      method = scope;
      scope = 'all';
    }
    key = key.replace(/\s/g,'');
    keys = key.split(',');

    if((keys[keys.length-1])=='')
      keys[keys.length-2] += ',';
    // for each shortcut
    for (i = 0; i < keys.length; i++) {
      // set modifier keys if any
      mods = [];
      key = keys[i].split('+');
      if(key.length > 1){
        mods = key.slice(0,key.length-1);
        for (mi = 0; mi < mods.length; mi++)
          mods[mi] = _MODIFIERS[mods[mi]];
        key = [key[key.length-1]];
      }
      // convert to keycode and...
      key = key[0]
      key = _MAP[key] || key.toUpperCase().charCodeAt(0);
      // ...store handler
      if (!(key in _handlers)) _handlers[key] = [];
      _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });
    }
  }
1345092
async def async_delete_all_keys(session, host, port, api_key, api_keys=[]):
    """"""
    url = 'http://{}:{}/api/{}/config'.format(host, str(port), api_key)

    response = await async_request(session.get, url)

    api_keys.append(api_key)
    for key in response['whitelist'].keys():
        if key not in api_keys:
            await async_delete_api_key(session, host, port, key)
1074351
private static function readKeys(): void
    {
        static::$keys = [];

        foreach (ini_get_all() as $key => $value) {
            static::$keys[$key] = $value['access'] === 1 /* user */ || $value['access'] === 7 /* all */;
        }
    }
975204
def onKeyReleaseInCanvas(self, event):
        ''''''
        char_map = { 'w':'move 0', 'a':'strafe 0', 's':'move 0', 'd':'strafe 0', ' ':'jump 0' }
        keysym_map = { 'Left':'turn 0', 'Right':'turn 0', 'Up':'pitch 0', 'Down':'pitch 0', 'Shift_L':'crouch 0', 'Shift_R':'crouch 0', 
                       '1':'hotbar.1 0', '2':'hotbar.2 0', '3':'hotbar.3 0', '4':'hotbar.4 0', '5':'hotbar.5 0',
                       '6':'hotbar.6 0', '7':'hotbar.7 0', '8':'hotbar.8 0', '9':'hotbar.9 0' }
        if event.char.lower() in char_map:
            self.agent_host.sendCommand( char_map[ event.char.lower() ] )
        elif event.keysym in keysym_map:
            self.agent_host.sendCommand( keysym_map[ event.keysym ] )
938905
def _filter_settings(settings, prefix):
    
    ret = {}
    for skey in settings.keys():
        if skey.startswith(prefix):
            key = skey[len(prefix):]
            ret[key] = settings[skey]
    return ret
818294
def _get_all_constants():
    
    return [
        key for key in globals().keys()
        if all([
            not key.startswith("_"),          # publicly accesible
            key.upper() == key,               # uppercase
            type(globals()[key]) in _ALLOWED  # and with type from _ALLOWED
        ])
    ]
490354
def alias_setting(*keys, to: nil)
      flat_setting = flatten_keys(keys)
      alias_keys = Array(to)
      alias_key = flatten_keys(alias_keys)

      if alias_key == flat_setting
        raise ArgumentError, 'Alias matches setting key'
      end

      if fetch(alias_key)
        raise ArgumentError, 'Setting already exists with an alias ' \
                             "'#{alias_keys.map(&:inspect).join(', ')}'"
      end

      @aliases[alias_key] = flat_setting
    end