Parse hash string
 value should be in the following format:
 "keyname: value, key2: value2"
336738
def process_hash(value)
      result = {}
      unless value.empty?
        value.split(",").each do |s|
          k,v = s.split(':').compact.map { |i| i.to_s.strip }
          result[k] = v.to_s
        end
      end
      result
    end
251052
def _format_param_value(key, value):
    
    if isinstance(value, str):
        value = "'{}'".format(value)
    return "{}={}".format(key, value)
787848
def to_camel_keys(value = self)
      case value
      when Array
        value.map { |v| to_camel_keys(v) }
      when Hash
        Hash[value.map { |k, v| [camelize_key(k), to_camel_keys(v)] }]
      else
        value
      end
    end
741145
def names_by_value(a)
      a = @data[a] if a.is_a?(String) || a.is_a?(Symbol)
      Hash[ a.map { |i| i.reverse } ]
    end
636023
function parseInputData(data) {
			var keyValRegExPattern = /[a-zA-Z]*:/g;
			var keys = data.match(keyValRegExPattern),
				values = data.split(keyValRegExPattern),
				parsedObject = {};

			// Pop the first blank one off the top
			values.shift();


			for(var i=values.length-1; i >=0; i--) {
				var value = values[i],
					key = keys[i];

				// Trim whitespace
				value = value.trim();

				// Trim any trailing commas
				if(value[value.length-1] === ",") {
					value = value.substring(0, value.length-1);
				}

				// Add to object and trim trailing : from key
				parsedObject[ key.substring(0,key.length-1) ] = value;
			}

			return parsedObject;

		}
198980
def hash_extractor(name, value)
      value.split(',').reduce({}) do |set, tag|
        k, v = tag.split(':')
        if v.nil?
          log_warn("Invalid hash value for #{name}: #{value}")
          return nil
        end

        set.merge(decode(k).downcase.to_sym => decode(v))
      end
    end
187731
def hash_to_rets_query_string(hash)
      [].tap do |str|
        hash.each_pair do |k,v|
          val = value_map(v)
          str << "(#{k.to_s.camelize}=#{val})"
        end
      end.join(',')
    end
93391
def to_hash
        h = {}
        keys.each { |k| h[ k ] = self.fetch( k ) }
        h
    end
231312
function argHashToArray(hash)
{
	var keys = Object.keys(hash);
	var result = [];
	for (var i = 0; i < keys.length; i++)
	{
		result[parseInt(keys[i], 10)] = hash[keys[i]];
	}
	return result;
}
1326951
function parse(headers) {
    var output = {}, i, p, k, v;
    headers = headers || '';
    headers = headers.replace('\r', '');
    headers = headers.split('\n');
    for(i = 0;i < headers.length;i++) {
      p = headers[i].indexOf(':');
      k = headers[i].substr(0, p);
      v = headers[i].substr(p + 1);
      if(k && v) {
        k = k.replace(/^\s+/, '').replace(/\s+$/, '');
        v = v.replace(/^\s+/, '').replace(/\s+$/, '');
        output[k.toLowerCase()] = v;
      }
    }
    return output;
  }
1079151
def to_hash(val)
      if @options[:humidity] then
        return {"humidity" => val.humidity}
      end

      if @options[:unit] == :c then
        if @options[:temperature] then
          return {"temperature" => val.temp}
        else
          return {"temperature" => val.temp, "humidity" => val.humidity}
        end
      else
        if @options[:temperature] then
          return {"temperature" => val.temp_f}
        else
          return {"temperature" => val.temp_f, "humidity" => val.humidity}
        end
      end
    end
1261606
def to_query_string_parameters(hash = {})
      properties = hash.map do |k, v|
        key   = URI.escape(k.to_s)
        value = URI.escape(v.to_s)

        "#{key}=#{value}"
      end

      if properties.empty?
        nil
      else
        properties.join("&")
      end
    end
815206
function (names) {
        this.names = Object.keys(names); // store the keys
        this.hash = util.map(names, function (value) { // store values for corresponding keys
            return parseInt(value, 10);
        });
    }
577015
def _parse_output_keys(val):
    
    out = {}
    for k in val.split(","):
        # record output
        if ":" in k:
            name, attrs = k.split(":")
            out[name] = attrs.split(";")
        else:
            out[k] = None
    return out
198116
def to_hash_with_values
      keys = table_header_keys
      values = self
      @hash_with_values = {}
      keys.each_with_index {|k,i| v=values[i]; v=v.value if v; @hash_with_values[k]=v}
      return @hash_with_values
    end
746727
def []=(key, value)
      raise ArgumentError, "key must be string" unless key.instance_of?(String)
      raise ArgumentError, "value must be string" unless value.instance_of?(String)

      @root_node = update_and_delete_storage(
        @root_node,
        NibbleKey.from_string(key),
        value
      )

      update_root_hash
    end
1309829
def string_keys(hash={})
      hash.inject({}) do |options, (key, value)|
        options[key.to_s] = value
        options
      end
    end