Feature: wrap array of array-of-hashes/object
434055
def translate_value(value)
      case value
        when Hash
          self.class.new(value)
        when Array
          value.map { |element| translate_value(element) }
        else
          value
      end
    end
1365322
function mapArray(f, a, HASH_ID) {

  var b =  [];
  for (var i = 0; i < a.length; i++) {
    b[i] = {};
    // b[i].hash = f(typeof a[i] === "string"? a[i]: JSON.stringify(a[i]));
    b[i].hash = f(a[i], HASH_ID);
    b[i].index = i;
    b[i].value = a[i];
  }
  return b;
}
1102721
function sortedHashKeys(obj, desc) {
		var keys = [];

		for (var key in obj)
			keys.push(key);

		return sort.call(keys, function(a,b) {
			return desc ? obj[b] - obj[a] : obj[a] - obj[b];
		});
	}
78399
function wrapMutatingArrayMethod(method, func) {
      return function() {
        var result = [][method].apply(obj, arguments);
        this.len = this.values.length;
        cache = {};
        children = {};
        func.apply(this, arguments);
        target.parent.trigger('update', target.prop);
        return result;
      };
    }
906619
def pluralized_array_from_hash(hash, singular_key, plural_key)
      [].tap do |array|
        value = value_from_singular_key(hash, singular_key)
        value ||= value_from_plural_key(hash, plural_key)
        array << value
      end.flatten.compact
    end
726983
def[](*keys)
      values = json.is_a?(Array) ? json : [json]
      keys.each { |key| values = values.map{ |value| value.is_a?(Hash) ? value[key] : nil} }
      json.is_a?(Array) ? values : values.first
    end
1128945
def combine_hashes(array_of_hashes)
      array_of_hashes.select {|v| v.kind_of?(Hash) }.
        inject({}) {|sum, hash| hash.inject(sum) {|sum,(k,v)| sum.merge(k => v) } }
    end
211193
def render_hash(hsh)
      str = ""
      indiff_hsh = hsh.with_indifferent_access
      indiff_hsh.keys.sort.each do |key|
        str << "#{key}: "
        value = indiff_hsh[key]
        PP::pp(value, str)
      end
      str
    end
1287039
function wrapObject(object, methods) {
      if (!(methods instanceof Array)) methods = Array.prototype.slice.call(arguments, 1);
      methods.forEach(function (method) {
        object[method] = wrap(object[method]);
      });
    }
1325717
def to_hash(arr)
      arr.map(&:flatten).map { |p| { 'key' => p.first.to_s, 'value' => p.last.to_s } }
    end
458664
function (name) {
        return Array.isArray(name) ? (name.map(this.valueOf.bind(this))) : this.hash[name];
    }
1153605
def []=(key, value)
      if columns.key?(key)
        @array[columns.index(key)] = value
      else
        @array << value
        columns << key
      end
      hash[key] = value
    end
399817
def wrap_value(value, lookup)
      if value.is_a?(Array)
        new_array_model(value, @options.merge(parent: self, path: path + lookup))
      elsif value.is_a?(Hash)
        new_model(value, @options.merge(parent: self, path: path + lookup))
      else
        value
      end
    end
1067382
def buffer_attributes_to_hash(attributes)
      '{' + attributes.inject([]) do |extend_map, (key, attribute)|
        extend_map << (
          ":\"#{key}\" => " + if key == :class
                                '[' + attribute.map do |exp|
                                  exp[@value]
                                end.join(', ') + ']'
                              else
                                attribute[@value]
                              end
        )
      end.join(', ') + '}'
    end
93391
def to_hash
        h = {}
        keys.each { |k| h[ k ] = self.fetch( k ) }
        h
    end
889710
def flatten_keys(hash, prev_key=nil, &block)
      hash.each_pair do |key, value|
        curr_key = [prev_key, key].compact.join('.')
        if value.is_a?(Hash)
          flatten_keys(value, curr_key, &block)
        else
          yield curr_key, value
        end
      end
    end
1204284
def hash_data(obj):
    """"""
    collect = sha1()
    for text in bytes_iter(obj):
        if isinstance(text, six.text_type):
            text = text.encode('utf-8')
        collect.update(text)
    return collect.hexdigest()