Converts a {JOSE::JWK JOSE::JWK} into a map.

 @param [String] key
 @param [JOSE::JWE] jwe
 @return [JOSE::Map]
178566
def to_map(key = nil, jwe = nil)
      if not key.nil?
        jwe ||= kty.key_encryptor(fields, key)
      end
      if key and jwe
        return JOSE::JWE.block_encrypt(key, to_binary, jwe)
      elsif kty.nil? and keys
        return keys.to_map(fields)
      else
        return kty.to_map(fields)
      end
    end
614133
def to_jwt(self, key=None, algorithm="", lev=0, lifetime=0):
        

        _jws = JWS(self.to_json(lev), alg=algorithm)
        return _jws.sign_compact(key)
1016159
def jwk_wrap(key, use="", kid=""):
    
    if isinstance(key, rsa.RSAPublicKey) or isinstance(key, rsa.RSAPrivateKey):
        kspec = RSAKey(use=use, kid=kid).load_key(key)
    elif isinstance(key, str):
        kspec = SYMKey(key=key, use=use, kid=kid)
    elif isinstance(key, ec.EllipticCurvePublicKey):
        kspec = ECKey(use=use, kid=kid).load_key(key)
    else:
        raise Exception("Unknown key type:key=" + str(type(key)))

    kspec.serialize()
    return kspec
1286046
public String hmset(Object key, Map<Object, Object> hash) {
		Jedis jedis = getJedis();
		try {
			Map<byte[], byte[]> para = new HashMap<byte[], byte[]>();
			for (Entry<Object, Object> e : hash.entrySet())
				para.put(fieldToBytes(e.getKey()), valueToBytes(e.getValue()));
			return jedis.hmset(keyToBytes(key), para);
		}
		finally {close(jedis);}
	}
706050
def _remap_key(key):
    
    if key in KNOWN_PARAMS:
        return key
    if key.lower() in known_params:
        return KNOWN_PARAMS[known_params.index(key.lower())]
    return key
1119287
function (key) {
            var modelVal = this.getModelVal();
            modelVal = this.multiple ? modelVal : [modelVal];
            return (_.indexOf(_.map(modelVal, toStr), toStr(key)) > -1);
        }
1034869
def symbolize_keys(hash)
      hash.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
    end
1262107
def map_keys(pvs, keys):
    
    rs = []
    for pv in pvs:
        r = dict((v, None) for k, v in keys.items())
        for k, v in pv.items():
            if k in keys:
                r[keys[k]] = v
            r[k] = v
        rs.append(r)
    return rs
513227
@SuppressWarnings("unchecked")
  private HamtPMap<K, V> pivot(K key, int hash) {
    return pivot(key, hash, null, (V[]) new Object[1]);
  }
960597
def <<(key)
      column = Column.new(@table, self, key)
      return if is_blank?(column.key) || key?(key)

      @column_indexes[column.key] = @columns.size
      @column_indexes[@columns.size] = column
      @columns_by_key[column.key] = column
      @columns << column
    end
1295133
def to_map
      map = alg.to_map(fields)
      if b64 == false or b64 == true
        map = map.put('b64', b64)
      end
      return map
    end
344762
private MValue setInMap(String key, MValue value) {
        newKey.add(key);
        valueMap.put(key, value);
        return value;
    }
205754
def []=(key, val)
      key = key.to_sym
      raise EnvironmentError, "#{key} already binded" if @map.has_key?(key)
      @map[key] = val
    end
1250487
def bind_key(key, kcb=nil, &bl)
      kcb = bl if kcb.nil? && !bl.nil?

      cb = lambda do |cdktype, widget, component, key|
        kcb.call component, key
      end

      component.bind(:ENTRY, key, cb, self)
    end
1192002
def [](key)
      if self.map? && @data.has_key?(key)
        @data[key]
      elsif (self.map?  && @data.has_value?(key)) ||
            (self.list? && @data.include?(key))
        key
      else
        nil
      end
    end
369121
def map_keys
      super
      @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'){ set_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() }
      # # commented since textpad is now calling this
      # this can be brought back into include and used from other textpad too.
      #require 'canis/core/include/listbindings'
      #bindings
    end
320551
def get_as_map(self, key):
        
        value = self.get(key)
        return AnyValueMap.from_value(value)