Extends source list to target list only if elements doesn't exists in target list.
    :param target:
    :type target: list
    :param source:
    :type source: list
422514
def extend_safe(target, source):
    
    for elt in source:
        if elt not in target:
            target.append(elt)
628625
def _compute_sources_for_target(self, target):
    """"""
    def resolve_target_sources(target_sources):
      resolved_sources = []
      for tgt in target_sources:
        if tgt.has_sources():
          resolved_sources.extend(tgt.sources_relative_to_buildroot())
      return resolved_sources

    sources = [s for s in target.sources_relative_to_buildroot() if self._sources_predicate(s)]
    # TODO: Make this less hacky. Ideally target.java_sources will point to sources, not targets.
    if hasattr(target, 'java_sources') and target.java_sources:
      sources.extend(resolve_target_sources(target.java_sources))
    return sources
560748
def execute(self, sources, target):
        
        fields = self._get_fields_list_from_eps(sources)
        target._ml_fields = copy.deepcopy(fields[0])
1038375
function merge(target, ...sources) {
  let targetObject = target;

  if (!isObj(target)) {
    targetObject = {};
  }

  // for all the sources provided merge them with
  // the target object
  sources.forEach((s) => {
    // before merging check the source is an object
    if (isObj(s)) {
      targetObject = mergeObject(targetObject, s);
    }
  });

  return targetObject;
}
1335964
def target_exists(self, target_id=0):
        
        try:
            target = self._target(target_id=target_id)
        except Exception as e:
            log.error("Exception checking if target exists: {} {}".format(type(e), e))
            return False
        return target is not None
1241975
function (target, source) {
        var key;

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

        return target;
    }
276254
public static <E> List<E> listify(ObjectMapper mapper, Object source, Class<E> targetElementType) {
        return (List<E>) collectify(mapper, source, List.class, targetElementType);
    }
500589
def _construct_target_list(targets):
    
    target_entries = []
    for entry in targets:
        if not isinstance(entry, Gtk.TargetEntry):
            entry = Gtk.TargetEntry.new(*entry)
        target_entries.append(entry)
    return target_entries
803380
function extend(source, target, deep) {
    if (deep) {
        return lodash.merge(lodash.cloneDeep(source), target);
    } else {
        return lodash.assignIn(source, target);
    }
}
673319
function merge(target, source) {
                target.additionalNodes = target.additionalNodes || [];
                target.additionalNodes.push(source.node);
                if (source.additionalNodes) {
                    (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);
                }
                target.children = ts.concatenate(target.children, source.children);
                if (target.children) {
                    mergeChildren(target.children);
                    sortChildren(target.children);
                }
                var _a;
            }
1125497
def calculate_sources(self, targets):
    """"""
    sources = set()
    for target in targets:
      sources.update(
        source for source in target.sources_relative_to_buildroot()
        if source.endswith(self._PYTHON_SOURCE_EXTENSION)
      )
    return sources
825658
def execute(self, sources, target):
        
        existing_ml_fields = self._get_fields_list_from_eps(sources)
        dup_ml_fields = [f.copy() for f in self.fields]
        if self.is_append:
            src = list([copy.deepcopy(f) for f in existing_ml_fields[0]])
            src.extend(dup_ml_fields)
            target._ml_fields = src
        else:
            target._ml_fields = self.fields
973458
public static <T> void copy(final T source, final T target) {

    if (isEmpty(source) || isEmpty(target)) {
      return;
    }
    int sourceLength = Array.getLength(source);
    int targetLength = Array.getLength(target);
    int minLenght = Math.min(sourceLength, targetLength);
    copy(source, target, 0, 0, minLenght);
  }
180213
public static <T, U extends Collection<T>> U addAllTo(Iterable<T> source, U target) {
        for (T item : source) {
            target.add(item);
        }
        return target;
    }
1210860
def create_from_targets(self,list_targs):
        
        for this_target in list_targs:
            self.node.append(this_target.get_node())
1220241
public static <T> Level0ListOperator<List<T>,T> onList(final List<T> target) {
        return new Level0ListOperator<List<T>,T>(ExecutionTarget.forOp(target, Normalisation.LIST));
    }
884545
def _calculate_python_sources(self, targets):
    """"""
    python_eval_targets = filter(self.is_non_synthetic_python_target, targets)
    sources = set()
    for target in python_eval_targets:
      sources.update(
        source for source in target.sources_relative_to_buildroot()
        if os.path.splitext(source)[1] == self._PYTHON_SOURCE_EXTENSION
      )
    return list(sources)