Allow one to pass the whole linked target object
506079
function toLink( data ) {
	if ( data && typeof data === 'object' ) {
		if ( data.constructor.name === 'ObjectID' || data.constructor.name === 'ObjectId' ) {
			return { _id: data } ;
		}

		data._id = toObjectId( data._id ) ;
	}
	else if ( typeof data === 'string' ) {
		try {
			data = { _id: mongodb.ObjectID( data ) } ;
		}
		catch ( error ) {}
	}

	return data ;
}
167113
function attachProps(context, target) {
  if (isObject(target)) {
    var keys = inheritedKeys(target);
    for (var i = 0, l = keys.length; i < l; ++i) {
      context[keys[i]] = clone(target[keys[i]]);
    }
  }
}
820764
function multiproject (pointer, target, path) {
            var pointerType = getTypeStr (pointer);
            var mainTarget;
            if (target)
                mainTarget = target;
            else
                if (pointerType == 'object')
                    target = {};
                else if (pointerType == 'array') {
                    target = [];
                    var remainingPath = path.slice (i);
                    for (var i in pointer) {
                        var found = multiproject (pointer[i], target[i], remainingPath);
                        if (found !== undefined)
                            target[i] = found;
                    }
                    return target;
                } else
                    return;

            for (var i=0,j=path.length-1; i<j; i++) {
                var pathStep = path[i];
                if (pathStep == '$')
                    throw new Error (
                        'cannot use the positional operator inside another Array'
                    );

                if (pointerType == 'array') {
                    if (!mainTarget) mainTarget = target;
                    var remainingPath = path.slice (i);
                    for (var k in pointer) {
                        var found = multiproject (pointer[k], target[k], remainingPath);
                        if (found !== undefined)
                            target[k] = found;
                    }
                    return mainTarget;
                } else if (pointerType != 'object')
                    return mainTarget; // if there's path left, we must be a container type

                if (!Object.hasOwnProperty.call (pointer, pathStep))
                    return mainTarget; // not found
                if (!mainTarget) mainTarget = target;
                pointer = pointer[pathStep];
                pointerType = getTypeStr (pointer);

                if (Object.hasOwnProperty.call (target, pathStep))
                    target = target[pathStep];
                else
                    if (pointerType == 'object')
                        target = target[pathStep] = {};
                    else
                        target = target[pathStep] = [];
            }

            var finalStep = path[path.length-1];
            if (!mainTarget) mainTarget = target;

            if (pointerType == 'array') {
                for (var k in pointer) {
                    var found = multiproject (pointer[k], target[k], [ finalStep ]);
                    if (found !== undefined)
                        target[k] = found;
                }
                return mainTarget;
            } else if (pointerType != 'object')
                return mainTarget;

            if (Object.hasOwnProperty.call (pointer, finalStep)) {
                target[finalStep] = pointer[finalStep];
                if (!mainTarget) mainTarget = target;
            }
            return mainTarget;
        }
939511
function (source, target) {
        var tmp;
        target = target || {};
        for (var i in source) {
            if (source.hasOwnProperty(i)) {
                tmp = source[i];
                if (typeof tmp == 'object') {
                    target[i] = utils.isArray(tmp) ? [] : {};
                    utils.clone(source[i], target[i])
                } else {
                    target[i] = tmp;
                }
            }
        }
        return target;
    }
1212790
def _refreshNodeFromTarget(self):
        
        for key, value in self.viewBox.state.items():
            if key != "limits":
                childItem = self.childByNodeName(key)
                childItem.data = value
            else:
                # limits contains a dictionary as well
                for limitKey, limitValue in value.items():
                    limitChildItem = self.limitsItem.childByNodeName(limitKey)
                    limitChildItem.data = limitValue
740275
static function link_object_to($from, $to, $params = [])
	{
		$data = [
			'from_class'=> $from->extends_class_id(),
			'from_id'	=> $from->id(),
			'to_class'	=> $to->extends_class_id(),
			'to_id'		=> $to->id(),
		];

		$link = bors_find_first('bors_link', $data);
		if($link)
		{
			$link->set_sort_order(defval($params, 'sort_order', 0));
			foreach($params as $k => $v)
				$link->set($k, $v, true);

			$link->set_target($to);
			$link->store();

			return false;
		}

		if(empty($params['owner_id']))
			$params['owner_id'] = bors()->user_id();

		$data['sort_order'] = defval($params, 'sort_order', 0);
		foreach($params as $k => $v)
			$data[$k] = $v;

		self::set_target_array($data, $to);

		$link = bors_new('bors_link', $data);

		if(method_exists($to, 'set_parent_object') && !$to->parent_object())
			$to->set_parent_object($from);

		echo "\nnew link {$from} => {$to}\n";

		$link->store();

		return true;
	}
505694
function (target, source) {
            var name, s;
            for (name in source) {
                s = source[name];
                if (!(name in target) || (target[name] !== s && (!(name in empty) || empty[name] !== s))) {
                    target[name] = s;
                }
            }
            return target; // Object
        }
984641
def symlink_to(self, target, target_is_directory=False):
        
        if self._closed:
            self._raise_closed()
        self._accessor.symlink(target, self, target_is_directory)
676775
function(oThis, oEvent){
		var jRef = jQuery(oEvent.target);
		if (!jRef.attr("itemidx")) {
			jRef = jRef.parent();
		}
		return jRef.attr("itemidx") ? jRef : null;
	}
38608
public void showOver(Node target) {
        requireNonNull(target, "Parameter 'target' is null");

        final Point2D center = center(target.localToScreen(target.getBoundsInLocal()));
        internalShow(target, target, center.getX(), center.getY());
    }
309013
function (object, e) {
      if (this._activeObject) {
        this._activeObject.setActive(false);
      }
      this._activeObject = object;
      object.setActive(true);

      this.renderAll();

      this.fire('object:selected', { target: object, e: e });
      object.fire('selected', { e: e });
      return this;
    }
714804
def push_target_elem(self, element, pseudo=None):
        """"""
        actions = self.state[self.state['current_step']]['actions']
        if len(actions) > 0 and actions[-1][0] == 'target':
            actions.pop()
        actions.append(('target', Target(element.etree_element,
                                         pseudo, element.parent.etree_element
                                         )))
49433
function() {
      var targetClass;
      var query;
      if (!this.targetClassName) {
        targetClass = Parse.Object._getSubclass(this.parent.className);
        query = new Parse.Query(targetClass);
        query._extraOptions.redirectClassNameForKey = this.key;
      } else {
        targetClass = Parse.Object._getSubclass(this.targetClassName);
        query = new Parse.Query(targetClass);
      }
      query._addCondition("$relatedTo", "object", this.parent._toPointer());
      query._addCondition("$relatedTo", "key", this.key);

      return query;
    }
896316
def init_target_object(self, target, data):
        
        target_object = self.init_single_object(target, data.pop(target, data))
        for key, item in data.items():
            key_alias = MANAGER_ALIASES.get(key, key)
            if item:
                # Item is an OrderedDict with 4 possible structure patterns:
                #   - Just an OrderedDict with (key - value)'s
                #   - OrderedDict with single (key - OrderedDict)
                #   - OrderedDict with multiple (key - OrderedDict)'s
                #   - String (like CreativeCode model)
                if isinstance(item, str):
                    children = item
                else:
                    first_key = list(item.keys())[0]
                    if isinstance(item[first_key], OrderedDict):
                        instances = item.values()
                        if len(instances) > 1:
                            children = [self.init_single_object(key_alias, instance) for instance in instances]
                        else:
                            children = self.init_single_object(key_alias, list(instances)[0])
                    else:
                        children = self.init_single_object(key_alias, item)
                setattr(target_object, key.lower(), children)
            else:
                setattr(target_object, key.lower(), None)
        return target_object
766099
static function link_objects($obj1, $obj2, $params = array())
	{
		if(!$obj1 || !$obj2)
			return false;

		// Don't use expression. I's lazy and not works for thow argument if first true.
		$up1 = self::link_object_to($obj1, $obj2, $params);
		$up2 = self::link_object_to($obj2, $obj1, $params);
		return $up1 || $up2;
	}
557816
function dispatchPointerLeave(currentTarget, relatedTarget, generateProxy) {
        var commonParent = getFirstCommonNode(currentTarget, relatedTarget);
        var node = currentTarget;
        while (node && node !== commonParent) {//target range: this to the direct child of parent relatedTarget
            if (checkEventRegistration(node, 'pointerleave'))//check if any parent node has pointerleave
                generateProxy(node);
            node = node.parentNode;
        }
    }
205097
def link(text, link_func):
    """"""
    def object_formatter(v, c, m, p):
        """Format object view link."""
        return Markup('<a href="{0}">{1}</a>'.format(
            link_func(m), text))
    return object_formatter