maps keys to methods
 checks @key_map can be :emacs or :vim.
186613
def map_keys
      @keys_mapped = true
      bind_key($row_selector, 'toggle row selection'){ toggle_row_selection() }
      bind_key(KEY_ENTER, 'toggle expanded state') { toggle_expanded_state() }
      bind_key(?o, 'toggle expanded state') { toggle_expanded_state() }
      bind_key(?f, 'first row starting with char'){ ask_selection_for_char() }
      bind_key(?\M-v, 'one key selection toggle'){ @one_key_selection = !@one_key_selection }
      bind_key(?O, 'expand children'){ expand_children() }
      bind_key(?X, 'collapse children'){ collapse_children() }
      bind_key(?>, :scroll_right)
      bind_key(?<, :scroll_left)
      # TODO
      bind_key(?x, 'collapse parent'){ collapse_parent() }
      bind_key(?p, 'goto parent'){ goto_parent() }
      require 'canis/core/include/deprecated/listbindings'
      #ListBindings.bindings
      bindings
    end
932171
function map(classMap) {
		if (typeof classMap === 'function') {
			options.classMap = classMap;
		} else {
			options.classMap = function (className) {
				return classMap[className] || className;
			};
		}
	}
561832
def method_missing(key, *args, &block)
      if key.to_s =~ /\A(.+)=\z/
        self[$1] = args.first
        return args.first
      end
      if key.to_s =~ /\A(.+)\?\z/
        return !!self[$1]
      end
      return self[key]  if has_key?(key)
      nil
    end
1153086
def default_key_map
      tp = source
      source.bind_key(?\M-n.getbyte(0), 'goto_end'){ tp.goto_end } 
      source.bind_key(?\M-p.getbyte(0), 'goto_start'){ tp.goto_start } 
    end
871644
def key(*keys)
      options = keys.extract_options!
      raise ArgumentError.new("has_settings: Option :defaults expected, but got #{options.keys.join(', ')}") unless options.blank? || (options.keys == [:defaults])
      keys.each do |key_name|
        unless key_name.is_a?(Symbol) || key_name.is_a?(String)
          raise ArgumentError.new("has_settings: symbol or string expected, but got a #{key_name.class}")
        end
      end

      options[:defaults].each do |k, v|
        has_settings(*keys).attr(k, default: v)
      end
    end
1278166
def _check_key(self, key):
        
        if not len(key) == 2:
            raise TypeError('invalid key: %r' % key)
        elif key[1] not in TYPES:
            raise TypeError('invalid datatype: %s' % key[1])
427206
def symbolize_keys(allowed: nil)
      allowed ||= self.class.allowed[:keys]
      each_with_object({}) do |(k, v), h|
        k = k.to_sym if k.respond_to?(:to_sym) && !allowed.include?(k.class)
        h[k] = !v.respond_to?(:symbolize_keys) ? v : v.symbolize_keys({
          :allowed => allowed
        })
      end
    end
169851
@MapMethod
    public List<String> keys(Map<String,Object> m){
        List<String> l = Objects.newArrayList();
        for(String k:m.keySet()){
            l.add(k);
        }
        return l;
    }
677761
def method_missing(name, *args, &block)
      return meta[name.to_s] if meta.key?(name.to_s)
      super
    end
868688
def define_key _keycode, *args, &blk
      _symbol = @symbol
      h = $rb_prefix_map[_symbol]
      raise ArgumentError, "No such keymap #{_symbol} defined. Use define_prefix_command." unless h
      _keycode = _keycode[0].getbyte(0) if _keycode[0].class == String
      arg = args.shift
      if arg.is_a? String
        desc = arg
        arg = args.shift
      elsif arg.is_a? Symbol
        # its a symbol
        desc = arg.to_s
      elsif arg.nil?
        desc = "unknown"
      else
        raise ArgumentError, "Don't know how to handle #{arg.class} in PrefixManager"
      end
      @descriptions[_keycode] = desc

      if !block_given?
        blk = arg
      end
      h[_keycode] = blk
    end
328203
def define_cmp_method
      keys = @keys
      define_method(:cmp?) do |comparator, other|
        keys.all? do |key|
          __send__(key).public_send(comparator, other.__send__(key))
        end
      end
      private :cmp?
    end
265929
function lookUpValueWithKeys(keys) {
    var key = goog.array.find(keys, versionMapHasKey);
    return versionMap[key] || '';
  }
749100
def map_keys
    return if @keys_mapped
    bind_key(KEY_F1, 'help') { hm = help_manager(); hm.display_help }
    bind_keys([?\M-?,?\?], 'show field help') { 
      #if get_current_field.help_text 
        #textdialog(get_current_field.help_text, 'title' => 'Help Text', :bgcolor => 'green', :color => :white) 
      #else
        print_key_bindings
      #end
    }
    bind_key(FFI::NCurses::KEY_F9, "Print keys", :print_key_bindings) # show bindings, tentative on F9
    bind_key(?\M-:, 'show menu') {
      fld = get_current_field
      am = fld.action_manager()
      #fld.init_menu
      am.show_actions
    }
    @keys_mapped = true
  end
1235454
def get_keys(self, keymap):
        """"""
        keys = dict(modifiers=[], regular=[])

        # loop on keymap bytes
        for keymap_index, keymap_byte in enumerate(keymap):
            try:
                keymap_values = self._keymap_values_dict[keymap_index]
            except KeyError:
                continue

            # loop on keymap_values for that keymap byte
            for key, value in keymap_values.items():
                if not keymap_byte & key:
                    continue
                elif value in self._modifiers:
                    keys['modifiers'].append(value)
                elif not keys['regular']:
                    keys['regular'].append(value)

        return keys
797543
def check_key(key, allowed):
    

    if key in allowed:
        return True

    for pattern in allowed:
        if fnmatch(key, pattern):
            return True

    return False
235437
def check_method(tab_ops, prefix, method_sym, do_call, *arguments, &block)
      method_sym = method_sym.id2name
      verb = :get
      [:post, :get, :delete, :put].each do |averb|
        if method_sym.start_with? averb.id2name
          verb = averb
          method_sym[averb.id2name + '_'] = ''
          break
        end
      end
      if tab_ops[verb].include? method_sym.to_sym
        if do_call
          params = arguments.first
          method = prefix + method_sym
          method += "/#{params.shift}"  if params.first && params.first.class != Hash
          return do_request verb, method, params.shift
        else
          return nil
        end
      end
      nil
    end
1359686
def to_h
      keys.map { |k| [k, map { |h| h[k] }] }.to_h
    end