Produce a single source tier that gathers from a set of tiers when
        the key function returns a unique result for each tier.
340090
def make_gatherer(cls, cell, source_tiers, gatherby):
        
        pending = collections.defaultdict(dict)
        tier_hashes = [hash(x) for x in source_tiers]

        @asyncio.coroutine
        def organize(route, *args):
            srchash = hash(route.source)
            key = gatherby(*args)
            group = pending[key]
            assert srchash not in group
            group[srchash] = args
            if len(group) == len(tier_hashes):
                del pending[key]
                yield from route.emit(*[group[x] for x in tier_hashes])
        return cls(cell, organize)
948467
private ReliabilitySubset createNonPersistentSubset(Reliability reliability)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "createNonPersistentSubset",
        new Object[] { reliability });
    
    ReliabilitySubset subset = new ReliabilitySubset(reliability, initialData);
    subsets[getIndex(reliability)] = subset;
    subsetIDs[getIndex(reliability)] = NO_ID;
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createNonPersistentSubset", subset);
    
    return subset;    
  }
1264440
function mix (receiver, supplier) {
  for (var key in supplier) {
    receiver[key] = supplier[key];
  }
  return receiver;
}
1250165
public LinkedHashMap<String, String> getTierToBrokerMap()
  {
    return tierToBrokerMap == null ? new LinkedHashMap<>(
        ImmutableMap.of(
            DruidServer.DEFAULT_TIER, defaultBrokerServiceName
        )
    ) : tierToBrokerMap;
  }
177034
def all_unique(keys, axis=semantics.axis_default):
    """"""
    index = as_index(keys, axis)
    return index.groups == index.size
246896
def add_source(self, tier):
        
        tier.add_dest(self)
        self.sources.append(tier)
531115
function sources(k) {
      (src[k] || []).forEach(function(s) { deps[s] = k; sources(s); });
    }
1031044
def makeHierarchy(sources):
    ''''''

    hierarchy = {}
    for file in sources:
        path = splitFully(file)
        if len(path):
            dict = hierarchy
            for part in path[:-1]:
                if part not in dict:
                    dict[part] = {}
                dict = dict[part]
            dict[path[-1]] = file
        #else:
        #    print 'Warning: failed to decompose path for '+str(file)
    return hierarchy
746878
def lookup(source, keys, fallback = None):
  """"""
  try:
    for key in keys:
      source = source[key]
    return source
  except (KeyError, AttributeError, TypeError):
    return fallback
736488
def distinct(iterable, keyfunc=None):
    '''
    '''
    seen = set()
    for item in iterable:
        key = item if keyfunc is None else keyfunc(item)
        if key not in seen:
            seen.add(key)
            yield item
1241975
function (target, source) {
        var key;

        for (key in source) {
            if (source.hasOwnProperty(key) && !_.isUndefined(source[key])) {
                target[key] = source[key];
            }
        }

        return target;
    }
1275090
def _get_final_set(self, sets, pk, sort_options):
        
        conn = self.cls.get_connection()
        all_sets = set()
        tmp_keys = set()

        if pk is not None and not sets and not (sort_options and sort_options.get('get')):
            # no final set if only a pk without values to retrieve
            return (None, False)

        elif sets or pk:
            if sets:
                new_sets, new_tmp_keys = self._prepare_sets(sets)
                all_sets.update(new_sets)
                tmp_keys.update(new_tmp_keys)
            if pk is not None:
                # create a set with the pk to do intersection (and to pass it to
                # the store command to retrieve values if needed)
                tmp_key = self._unique_key()
                conn.sadd(tmp_key, pk)
                all_sets.add(tmp_key)
                tmp_keys.add(tmp_key)

        else:
            # no sets or pk, use the whole collection instead
            all_sets.add(self.cls.get_field('pk').collection_key)

        if not all_sets:
            delete_set_later = False
            final_set = None
        elif len(all_sets) == 1:
            # if we have only one set, we  delete the set after calling
            # collection only if it's a temporary one, and we do not delete
            # it right now
            final_set = all_sets.pop()
            if final_set in tmp_keys:
                delete_set_later = True
                tmp_keys.remove(final_set)
            else:
                delete_set_later = False
        else:
            # more than one set, do an intersection on all of them in a new key
            # that will must be deleted once the collection is called.
            delete_set_later = True
            final_set = self._combine_sets(all_sets, self._unique_key())

        if tmp_keys:
            conn.delete(*tmp_keys)

        # return the final set to work on, and a flag if we later need to delete it
        return (final_set, [final_set] if delete_set_later else None)
1236605
function(source) {
		if (helpers.isArray(source)) {
			return source.map(helpers.clone);
		}

		if (helpers.isObject(source)) {
			var target = {};
			var keys = Object.keys(source);
			var klen = keys.length;
			var k = 0;

			for (; k < klen; ++k) {
				target[keys[k]] = helpers.clone(source[keys[k]]);
			}

			return target;
		}

		return source;
	}
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;
	}
1373777
public static <K, V> Set<Map<K, V>> setify(ObjectMapper mapper, Object source, Class<K> targetKeyType, Class<V> targetValueType) {
        return (Set<Map<K, V>>) collectify(mapper, source, Set.class, targetKeyType, targetValueType);
    }
48353
function promisifyAll(sourceObject, keys){
    // promisified output
    const promisifiedFunctions = {};

    // process each object key
    for (const name of keys){
        // function exist in source object ?
        if (name in sourceObject && typeof sourceObject[name] === 'function'){
            // create promisified named version
            promisifiedFunctions[name] = _promisify(sourceObject[name], name);
        }
    }

    return promisifiedFunctions;
}
1236925
private ReliabilitySubset createPersistentSubset(Reliability reliability,
      TransactionCommon tran) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this, tc, "createPersistentSubset", new Object[] { reliability });
    
    ReliabilitySubset subset = new ReliabilitySubset(reliability, initialData);
    subsets[getIndex(reliability)] = subset;
    if(reliability.compareTo(Reliability.BEST_EFFORT_NONPERSISTENT) > 0)
    {
      try
      {
        Transaction msTran = txManager.resolveAndEnlistMsgStoreTransaction(tran);
        itemStream.addItem(subset, msTran);
        subsetIDs[getIndex(reliability)] = subset.getID();
      }
      catch (MessageStoreException e)
      {        
        // FFDC
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.gd.StreamSet.createPersistentSubset",
          "1:398:1.67",
          this);
          
        //not sure if this default is needed but better safe than sorry
        subsetIDs[getIndex(reliability)] = NO_ID;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
          SibTr.exception(tc, e);
          SibTr.exit(tc, "createPersistentSubset", e);
        }
      }
    }
    else
    {
      subsetIDs[getIndex(reliability)] = NO_ID;    
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createPersistentSubset", subset);
    return subset;
  }