map/collect on a given property
11335
def map(input, property)
      InputIterator.new(input).map do |e|
        e = e.call if e.is_a?(Proc)

        if property == "to_liquid".freeze
          e
        elsif e.respond_to?(:[])
          r = e[property]
          r.is_a?(Proc) ? r.call : r
        end
      end
    rescue TypeError
      raise_property_error(property)
    end
867768
function map (obj) {
  var key, val, arr = []
  for (key in obj) {
    val = obj[key]
    if (Array.isArray(val))
      for (var i = 0; i < val.length; i++)
        arr.push([key, val[i]])
    else if (typeof val === 'object')
      for (var prop in val)
        arr.push([key + '[' + prop + ']', val[prop]])
    else
      arr.push([key, val])
  }
  return arr
}
1254451
function someProperties(map, predicate) {
        for (var key in map) {
            if (!predicate || predicate(map[key], key))
                return true;
        }
        return false;
    }
633952
def where(input, property, value)
      return input unless input.respond_to?(:select)
      input = input.values if input.is_a?(Hash)
      input.select do |object|
        Array(item_property(object, property)).map(&:to_s).include?(value.to_s)
      end || []
    end
1249017
public static Map<?, ?> convertToMap(Collection<?> coll, String keyProperty) {
    Map<Object, Object> map = newHashMap();
    for (Object obj : coll) {
      Object key = null;
      try {
        key = PropertyUtils.getProperty(obj, keyProperty);
      } catch (Exception e) {
        Throwables.propagate(e);
      }
      map.put(key, obj);
    }
    return map;
  }
1253816
function(source, domap, thisp) {
		var result = {},
			mapping;
		this.each(source, function(key, value) {
			mapping = domap.call(thisp, key, value);
			if (mapping !== undefined) {
				result[key] = mapping;
			}
		});
		return result;
	}
493650
function mapValues(object, iteratee) {
    var newObject = Object.assign({}, object);
    return Object.keys(object).reduce(function (records, key) {
        records[key] = iteratee(object[key], key, object);
        return records;
    }, newObject);
}
86684
function map_p(collection, func_p) {
  if (collection.length === 0)
    return Q.resolve([]);

  var results = [];

  var lastFunc = Q.resolve(true);

  _.each(collection, function(el, index) {
    lastFunc = lastFunc.then(function() {
      return func_p(collection[index])
      .then(function(result) {
	results[index] = result;
	return results;
      });
    });
  });

  return lastFunc;
}
116420
def filter(self, collection, data, **kwargs):
        """"""
        ops = self.parse(data)
        collection = self.apply(collection, ops, **kwargs)
        return ops, collection
654483
def get_by(self, prop, val, raise_exc=False):
        ''''''
        try:
            val = self.serialize(val)
            return self._meta[prop][val][0]
        except (KeyError, IndexError):
            if raise_exc:
                raise
            else:
                return None
1113456
public <V> Reflecter<T> populate(Map<String, V> properties) {
		return populate(properties, new String[]{});
	}
1003723
function Collection(options) {
  Base.call(this, options);
  this.define('lists', {});
  this.define('_items', {});
  this.define('Item', this.options.Item || require('./item'));
  this.define('List', this.options.List || require('./list'));
  mixins(this);

  /**
   * Get an object representing the current items on the instance.
   *
   * ```js
   * var items = this.items;
   * ```
   *
   * @return {Object} Object of items
   */

  Object.defineProperty(this, 'items', {
    enumerable: false,
    configurable: true,
    get: function () {
      return this._items;
    },
    set: function (items) {
      lazy.forIn(items, function (item, key) {
        delete this._items[key];
        delete this[key];
        this.set(key, item);
      }, this);
    }
  });
}
1185388
function (property, callback) {
        // if only one arg we count the collection
        if ([].slice.call(arguments).length === 1) {
            callback = property 
            property = 'key'
        } 
        var c = 0 
        this.each(function(e){
            if (e[property]) c++
        })
        this.fn('count', callback).call(this, c)
    }
237832
function mapXSetItems (items) {
  let results = [];
  for (let i = 0; i < items.length; i += 1) {
    results.push({
      timestamp: items[i][0],
      field: items[i][1][0],
      value: items[i][1][1]
    });
  }
  return results;
}
576150
function (collection, callback) {
        var index,
            iterable = collection,
            result = iterable;

        if (!iterable) {
            return result;
        }

        if (!sofa.Util.objectTypes[typeof iterable]) {
            return result;
        }

        for (index in iterable) {
            if (Object.prototype.hasOwnProperty.call(iterable, index)) {
                if (callback(iterable[index], index, collection) === false) {
                    return result;
                }
            }
        }
        return result;
    }
120166
public static Map extractToMap(final Collection collection, final String keyPropertyName, final String valuePropertyName) {
		Map map = new HashMap(collection.size());

		try {
			for (Object obj : collection) {
				map.put(PropertyUtils.getProperty(obj, keyPropertyName), PropertyUtils.getProperty(obj, valuePropertyName));
			}
		} catch (ReflectiveOperationException e) {
			throw new ReflectionRuntimeException(e);
		}

		return map;
	}
1001671
@Override
	public <T> List<T> collect(final Class<T> type) {
		try (Stream<T> stream = stream(new EntityResultSetConverter<>(type, new PropertyMapperManager()))) {
			return stream.collect(Collectors.toList());
		}
	}