Allow hash.default => hash['default']
 without breaking Hash's usage of default(key)
359065
def default(key = self.default_key)
      key = key.to_s if key.is_a?(Symbol)
      if key == self.default_key 
        self['default'] if key?('default')
      else
        hash_default(key)
      end
    end
934564
def hash_reassoc1(hash, key)
      hash = hash.dup if hash.frozen?
      old_value = hash[key]
      old_value = old_value.dup if duplicable?(old_value)
      new_value = yield old_value
      new_value.freeze if duplicable?(new_value)
      hash.store(key, new_value)
      hash.freeze
    end
199137
def add(self, key, value):
        # type: (Hashable, Any) -> None
        
        dict.setdefault(self, key, []).append(value)
1123515
def indifferent_hash
      Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
    end
228674
def safe_hash
      Hash[map do |key, value|
        if Protocol::RESERVED_KEYS.include?(key)
          nil
        elsif value.is_a?(Hash) &&
              value[Protocol::KEY_TYPE] == Protocol::TYPE_RELATION
          nil
        elsif value.nil?
          [key, Protocol::DELETE_OP]
        else
          [key, Parse.pointerize_value(value)]
        end
      end.compact]
    end
370721
def put( key, value )
    key = normalize_key( key )
    setter = "#{key}=".to_sym

    if respond_to?( setter )
      send( setter, value )
    else
      @hash[ key ] = value
    end
  end
735765
def default_hash(env = ActiveRecord::ConnectionHandling::DEFAULT_ENV.call.to_s)
      default = find_db_config(env)
      default.config if default
    end
1030576
def fetch(key, type, default = nil)
			if (real_hash.has_key?(key))
				value = real_hash[key]

				# if type is not an array, but value is, flatten it.
				if (type != Array && !type.kind_of?(Array) && value.kind_of?(Array))
					value = value[0]
				end

				real = type.from_user_input(value)
				if (real != nil)
					return real
				end
			end
			return default
		end
336263
def upper_hash_to_lower_hash( upper )
			case upper
			when Hash
        upper.inject({}) do |lower,array|
					key, value = array
          lower[key.downcase] = upper_hash_to_lower_hash( value )
					lower
        end
      else
        upper
      end
    end
3301
def options
      Hash[
        DeskApi::Configuration.keys.map do |key|
          [key, instance_variable_get(:"@#{key}")]
        end
      ]
    end
891562
def setdefault(self, key, default=None):
        
        if key in self.cache:
            return self.cache[key]

        def setdefault_trans(pipe):
            pickled_key = self._pickle_key(key)

            pipe.multi()
            pipe.hsetnx(self.key, pickled_key, self._pickle_value(default))
            pipe.hget(self.key, pickled_key)

            __, pickled_value = pipe.execute()

            return self._unpickle(pickled_value)

        value = self._transaction(setdefault_trans)

        if self.writeback:
            self.cache[key] = value
        return value
12156
def cli_hash(list_of_kv):
    """"""
    ev_obj = {}
    for extra_var in list_of_kv:
        ev_list = extra_var.split('=')
        key = ev_list[0]
        val = '='.join(ev_list[1:])  # b64 and other side effects
        ev_obj[key] = val

    return ev_obj
1317988
def setdefault (self, key, *args):
        """"""
        if key not in self:
            self._keys.append(key)
        return super(ListDict, self).setdefault(key, *args)
1519
def headers(h = nil)
      if h
        raise ArgumentError, 'Headers must be an object which responds to #to_hash' unless h.respond_to?(:to_hash)
        default_options[:headers] ||= {}
        default_options[:headers].merge!(h.to_hash)
      else
        default_options[:headers] || {}
      end
    end
674281
def hash(self):
        '''
        
        '''
        if self._hash is None:
            self._initialize()
            self._hash = khash(type(self).__name__, self._default_value, self._fuzzable)
        return self._hash
1095768
function set_default(obj, key, value, pred) {
        function valid_keyp(){
            return pred?          pred(obj[key], key, obj)
                 : /* default */  hasp(obj, key) }

        if (!valid_keyp())  obj[key] = value
        return obj[key]
    }
254983
def normalize(path, extra=nil, params={})
      if extra.is_a?(Hash) and params.empty?
        params = extra
        extra = nil
      end

      path = "#{path}/#{extra}" if extra
      path = "/#{path}" unless path[0] == '/'

      query = default_query.merge params

      params[:query] = query unless query.empty?
      params = default_params.merge params

      [path, extra, params]
    end