Takes a list of object and merges them into a template stub
334818
function compileFunction() {
  let template = {};

  if (arguments) {
    for (let arg of arguments) {
      mergeArgumentsTemplate(template, arg, 'Metadata');
      mergeArgumentsTemplate(template, arg, 'Parameters');
      mergeArgumentsTemplate(template, arg, 'Mappings');
      mergeArgumentsTemplate(template, arg, 'Conditions');
      mergeArgumentsTemplate(template, arg, 'Resources');
      mergeArgumentsTemplate(template, arg, 'Outputs');
      mergeArgumentsTemplate(template, arg, 'Variables');
      let areValidPolicies = arg.Policies && Array.isArray(arg.Policies) && arg.Policies.length > 0;
      if (areValidPolicies) {
        if (!template.Policies) {
          template.Policies = [];
        }
        template.Policies = template.Policies.concat(arg.Policies);
      }
    }
  }

  return template;
}
693100
async function renderList(nj, templList, templateVars) {
  const renderedList = await Promise.map(
    _.without(templList, _.isUndefined),
    async(it) => render(nj, it, templateVars));
  return renderedList;
}
500633
function deepmerge(foo, bar) {
			var merged = {};
			for (var each in bar) {
				if (each in foo) {
					if (typeof(foo[each]) == "object" && typeof(bar[each]) == "object") {
						merged[each] = deepmerge(foo[each], bar[each]);
					} else {
						merged[each] = [foo[each], bar[each]];
					}
				} else {
					merged[each] = bar[each];
				}
			}
			for (var each in foo) {
				if (!(each in bar)) {
					merged[each] = foo[each];
				}
			}
			return merged;
		}
603698
function mergeInner(base, mixin, mergeArrays) {
    if (base === null || typeof base !== 'object' || Array.isArray(base)) {
        throw new Error('base must be object');
    }
    if (mixin === null || typeof mixin !== 'object' || Array.isArray(mixin)) {
        throw new Error('mixin must be object');
    }
    Object.keys(mixin).forEach((name) => {
        mergeHelper(base, mixin, name, mergeArrays);
    });
}
185814
def deduplicate(list_object):
    """"""
    new = []
    for item in list_object:
        if item not in new:
            new.append(item)
    return new
1223131
function loadMany(names, skipCache = false) {
    if (names === undefined) {
        return [];
    }
    if (!Array.isArray(names)) {
        throw new Error('LoadMany is expecting an array.');
    }
    return names.reduce((acc, name) => {
        if (promiseWaiting.indexOf(name) !== -1) {
            return acc;
        }
        promiseWaiting.push(name);
        return acc.concat([loadListByName(name, null, skipCache).then(dataList => ({ name, dataList: dataList }))]);
    }, []);
}
289108
function _prepareKeys(template, key) {
  return [].concat.apply([], _checkBraces(key).map(function (k) {
    return _checkEach(template, k);
  }));
}
732128
@SuppressWarnings("unchecked")
	private void mergeArrayList(ShardRequest sreq, NamedList<Object> mtasResponse, String key, Integer preferredPurpose,
			boolean mergeAllShardResponses) {
		// create new response for key
		ArrayList<Object> mtasListResponse;
		Object o = mtasResponse.get(key);
		if (o instanceof ArrayList) {
			mtasListResponse = (ArrayList<Object>) o;
		} else {
			mtasListResponse = new ArrayList<>();
			mtasResponse.removeAll(key);
			mtasResponse.add(key, mtasListResponse);
		}
		// collect responses for each shard
		HashMap<String, ArrayList<Object>> mtasListShardResponses = new HashMap<>();
		ArrayList<ArrayList<Object>> mtasListShardResponsesExtra = new ArrayList<>();
		for (ShardResponse response : sreq.responses) {
			// only continue if new shard or preferred purpose
			if (mtasListShardResponses.containsKey(response.getShard())
					&& ((preferredPurpose == null) || (sreq.purpose != preferredPurpose))) {
				break;
			}
			// update
			try {
				NamedList<Object> result = response.getSolrResponse().getResponse();
				ArrayList<Object> data = (ArrayList<Object>) result.findRecursive("mtas", key);
				if (data != null) {
					if (mtasListShardResponses.containsKey(response.getShardAddress())) {
						if (mergeAllShardResponses) {
							mtasListShardResponsesExtra.add(data);
						}
					} else {
						mtasListShardResponses.put(response.getShardAddress(), data);
					}
				}
			} catch (ClassCastException e) {
				log.error(e);
			}
		}

		try {
			for (ArrayList<Object> mtasListShardResponse : mtasListShardResponses.values()) {
				mergeResponsesArrayList(mtasListResponse, mtasListShardResponse);
			}
			for (ArrayList<Object> mtasListShardResponse : mtasListShardResponsesExtra) {
				mergeResponsesArrayList(mtasListResponse, mtasListShardResponse);
			}
		} catch (IOException e) {
			log.error(e);
		}
	}
65805
function doesObjectListHaveDuplicates(l) {
    const mergedList = l.reduce((merged, obj) => (
        obj ? merged.concat(Object.keys(obj)) : merged
    ), []);

    // Taken from: http://stackoverflow.com/a/7376645/1263876
    // By casting the array to a Set, and then checking if the size of the array
    // shrunk in the process of casting, we can check if there were any duplicates
    return new Set(mergedList).size !== mergedList.length;
}
441837
function concatenateAllValuesForExtendeds (map) {
  let res = []
  Object.keys(map).forEach(function (key) {
    res = res.concat(map[key][1])
  })
  return res
}
513201
function merge() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i] = arguments[_i];
    }
    var concurrent = Number.POSITIVE_INFINITY;
    var scheduler = null;
    var last = observables[observables.length - 1];
    if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(last)) {
        scheduler = observables.pop();
        if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
            concurrent = observables.pop();
        }
    }
    else if (typeof last === 'number') {
        concurrent = observables.pop();
    }
    if (scheduler === null && observables.length === 1 && observables[0] instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
        return observables[0];
    }
    return Object(_operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__["mergeAll"])(concurrent)(Object(_fromArray__WEBPACK_IMPORTED_MODULE_3__["fromArray"])(observables, scheduler));
}
1332737
def merge_result(res):
    
    if not isinstance(res, dict):
        raise ValueError('Value should be of dict type')

    result = set([])

    for _, v in res.items():
        for value in v:
            result.add(value)

    return list(result)
844871
function (target, objects, options) {

            for (var object in objects) {
                if (objects.hasOwnProperty(object)) {
                    recursiveMerge(target, objects[object]);
                }
            }

            function recursiveMerge(target, object) {
                for (var property in object) {
                    if (object.hasOwnProperty(property)) {
                        var current = object[property];
                        if (utils.getConstructor(current) === 'Object') {
                            if (!target[property]) {
                                target[property] = {};
                            }
                            recursiveMerge(target[property], current);
                        }
                        else {
                            // clearEmpty
                            if (options.clearEmpty) {
                                if (current == null) {
                                    continue;
                                }
                            }
                            target[property] = current;
                        }
                    }
                }
            }

            return target;
        }
1262873
def stub_batch(cls, size, **kwargs):
        
        return [cls.stub(**kwargs) for _ in range(size)]
1099607
function mergeTemplateAndModel (source, data) {
  var renderer = data ? underscore.template : dummyRenderer
  return renderer(source, data)
}
67558
function merge(object, options, ...sources) {

	/* iterate through all provided sources */
	for(const source of sources) {

		/* retrieve the property names defined on object */
		const propNames = Object.getOwnPropertyNames(source);

		/* recursively merge properties */
		for(const name of propNames) {
			const value = source[name];

			/* skip undefined values */
			if(options && options.skipUndefined && value === undefined) {
				continue;
			}

			/* skip if both values equals */
			if(value === object[name]) {
				continue;
			}

			/* merge based on options */
			if(value && typeof value === "object") {
				if(options && options.arrayConcat && Array.isArray(object[name]) && Array.isArray(value)) {
					object[name] = object[name].concat(value);
					if(options && options.arrayUnique) {
						object[name] = Array.from(new Set(object[name]));
					}
				} else if(Array.isArray(value)) {
					object[name] = options && options.overwrite || object[name] === undefined ? value : object[name];
				} else {
					object[name] = merge(object[name] || {}, options, value);
				}
			} else {
				object[name] = options && options.overwrite || object[name] === undefined ? value : object[name];
			}

		}

	}

	/* return merged object */
	return object;
}
310715
function(into, from) {
  for (var key in from) {
    if (into[key] instanceof Object &&
        !(into[key] instanceof Array) &&
        !(into[key] instanceof Function)) {
      merge_(into[key], from[key]);
    } else {
      into[key] = from[key];
    }
  }
  return into;
}