/*
Similar to extend, but only includes the properties that are listed in filter (filter).
You can add an arbitrary number of objects as arguments.
Tickets: CLOUD-65
194372
function(target, filter) {
      _.each(slice.call(arguments, 2), function(source) {
        var prop, _results;
        _results = [];
        for (prop in source) {
          if (source[prop] !== void 0 && _.include(filter, prop)) {
            _results.push(target[prop] = source[prop]);
          } else {
            _results.push(void 0);
          }
        }
        return _results;
      });
      return target;
    }
941162
public void addFilterClause(final String property, final String condition, final Object value,
        final String fieldName, final boolean ignoreCase) {
        if (property != null && condition != null) {
            FilterClause filterClause = new FilterClause(property.trim(), condition.trim(), value, fieldName);
            filterClause.setIgnoreCase(ignoreCase);
            filtersQueue.add(filterClause);
        } else {
            filtersQueue.add(property);
        }
    }
717499
function filterObject(gobj, filter) {
	let found = true;
	let obj = gobj;

	// find the value we're interested in
	for (let i = 0, len = filter.length; obj && typeof obj === 'object' && i < len; i++) {
		if (!obj.hasOwnProperty(filter[i])) {
			found = false;
			obj = undefined;
			break;
		}
		obj = obj[filter[i]];
	}

	return { found, obj };
}
61626
function applyFilter(o, filter) {
      if (!config.filterRoute)
        return o
      // for prevent change original object, only
      var newO = {
        name: o.name,
        extlang: o.extlang,
        objects: JSON.parse(JSON.stringify(o.objects)),
        lines: o.lines.slice()
      }
      if (!config.filterRoute(newO, filter)) {
        return null
      }
      return newO
    }
376733
function extend(from, to, path, overrideLoc) {
  for (var prop in from) {
    if (!(prop in to) || (prop == "loc" && overrideLoc)) {
      to[prop] = from[prop]
    } else if (prop == "properties" || prop == "staticProperties") {
      extend(from[prop], to[prop], path.concat(prop))
    } else {
      var msg = "Conflicting information for " + path.join(".") + "." + prop
      if (to.loc) msg += " at " + to.loc.file + ":" + to.loc.line
      if (from.loc) msg += (to.loc ? " and " : " at ") + from.loc.file + ":" + from.loc.line
      throw new SyntaxError(msg)
    }
  }
  return to
}
628895
def filter(self, *args, **kwargs):
        
        clone = self._clone()
        for f in args:
            clone.filter_obj.add_filter(f)
        for key, value in kwargs.items():
            clone.filter_obj.add_filter_param(key, value)
        return clone
1250019
function extend( obj, var_args ) {
        for ( var i = 1; i < arguments.length ; i += 1 ) {
            var other = arguments[ i ];
            for ( var p in other ) {
                var v = Object.getOwnPropertyDescriptor( other, p );
                if ( typeof v == "undefined" || typeof v.value == "undefined" ) {
                    delete obj[ p ];
                } else {
                    Object.defineProperty( obj, p, v );
                }
            }
        }
        return obj;
    }
1349274
function extend(src, props) {
		props = props || {};
		var p;
		for (p in src) {
			if (src.hasOwnProperty(p)) {
				if (!props.hasOwnProperty(p)) {
					props[p] = src[p];
				}
			}
		}
		return props;
	}
833122
function extend(targetObj, sourceObject) {
        for (var key in sourceObject) {
            if (sourceObject.hasOwnProperty(key)) {
                targetObj[key] = sourceObject[key];
            }
        }
    }
342700
def object_filter(filter)
    raise ArgumentError, "object_filter expects an instance of SoftLayer::ObjectFilter" if filter.nil? || !filter.kind_of?(SoftLayer::ObjectFilter)

    # we create a new object in case the user wants to store off the
    # filter chain and reuse it later
    APIParameterFilter.new(self.target, @parameters.merge({:object_filter => filter}));
  end
1312777
private void addFilter(Filter filter) {
        boolean exists = false;
        for (Filter initedFilter : this.filters) {
            if (initedFilter.getClass() == filter.getClass()) {
                exists = true;
                break;
            }
        }

        if (!exists) {
            filter.init(this);
            this.filters.add(filter);
        }

    }
1017000
function extend(a, b) {
        for (var i in b) {
            if (b.hasOwnProperty(i)) {
                a[i] = b[i];
            }
        }

        if (b.hasOwnProperty("toString")) {
            a.toString = b.toString;
        }

        if (b.hasOwnProperty("valueOf")) {
            a.valueOf = b.valueOf;
        }

        return a;
    }
1241213
function extend(object, properties) {
  object = object || { };
  const anotherObject = properties || { };

  for (const key in anotherObject) {
    const val = anotherObject[key];

    if (val || (val === '')) {
      object[key] = val;
    }
  }
  return object;
}
444308
function extend() {
  var result = {};
  var objs = Array.prototype.slice.call(arguments,0);
  objs.forEach(function(props, index){
    for(var prop in props) {
      if(props.hasOwnProperty(prop)) {
        result[prop] = props[prop]
      }
    }
  });
  return result;
}
660387
function extend(o) {
  if (typeOf(o) !== 'object') { return {}; }
  var args = arguments;
  var len = args.length - 1;

  for (var i = 0; i < len; i++) {
    var obj = args[i + 1];

    if (typeOf(obj) === 'object' && typeOf(obj) !== 'regexp') {
      for (var key in obj) {
        if (obj.hasOwnProperty(key)) {
          o[key] = obj[key];
        }
      }
    }
  }
  return o;
}
959933
function expand(property, value, recurse) {
    ASSERT(arguments.length, 'property argument is required');

    if (arguments.length < 3) {
        if (typeof value === 'boolean') {
            recurse = value;
            value = undefined;
        } else {
            recurse = true;
        }
    }

    var undefvalue = typeof value === 'undefined';

    return undefvalue?
        expandAsArray(property, recurse)
        : expandAsObject(property, value, recurse);
}
233881
function extend(object, subject, ignoredKeys) {
    if (arrayOrNil(subject)) {
      for (var len = subject.length; --len >= 0;) { extend(object, subject[len], ignoredKeys); }
    } else {
      ignoredKeys = ignoredKeys || { constructor: 1, $super: 1, prototype: 1, $superp: 1 };

      var iClass     = classOrNil(object),
          isSubClass = classOrNil(subject),
          oPrototype = object.prototype, key, proto;

      // copy static properties and prototype.* to object
      if (mapOrNil(subject) || iClass) {
        for (key in subject) {
          copier(key, subject[key], ignoredKeys, object, iClass, oPrototype);
        }
      }

      if (isSubClass) {
        proto = subject.prototype;
        for (key in proto) {
          copier(key, proto[key], ignoredKeys, object, iClass, oPrototype);
        }
      }

      // prototype properties
      if (iClass && isSubClass) { extend(oPrototype, subject.prototype, ignoredKeys); }
    }
  }