Sets new object to the container

@param {string|object} name      Object name or hash of the objects
@param {string}        factory   Factory name
@param {*}             object    Object or its factory method
@returns {Injector} this

@this {Injector}
761984
function(name, factory, object) {

                        var that = this;
                        var objects = this._resolveObjects(name, factory, object);

                        _.each(objects, function(factoryObjects, factory) {
                            _.each(factoryObjects, function(object, name) {
                                that._setObjectCreator([name], that._createObjectCreator(factory, object));
                            });
                        });

                        return this;
                    }
884050
function createFactory(descriptor) {
  return function Stamp(options = {}, ...args) {
    // The 'methods' metadata object becomes the prototype for new object instances.
    const instance = Object.create(descriptor.methods || {});

    // Deep merge, then override with shallow merged properties, then apply property descriptors.
    merge(instance, descriptor.deepProperties);
    assign(instance, descriptor.properties);
    Object.defineProperties(instance, descriptor.propertyDescriptors || {});

    // Run initializers sequentially.
    return (descriptor.initializers || [])
      .filter(isFunction)
      .reduce((resultingInstance, initializer) => {
        // Invoke an initializer in the way specification tell us to.
        const returnedValue = initializer.call(
          // 'this' context will be the object instance itself
          resultingInstance,
          // the first argument passed from factory to initializer
          options,
          // special arguments. See specification.
          {instance: resultingInstance, stamp: Stamp, args: [options].concat(args)}
        );

        // Any initializer can override the object instance with basically anything.
        return returnedValue === undefined ? resultingInstance : returnedValue;
      }, instance);
  };
}
1118538
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof NamePart)){
    return new NamePart(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(NamePart.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
365911
function(factory, options) {
			this.base(options);
			this.factory = factory;
			this.callback(this.callbacks.init);	
			this.callback(this.callbacks.create);
		}
933183
protected function setProperty($object, $name = null)
    {
        if ($name === null) {
            $this->params[] = $object;
        } else {
            $this->params[$name] = $object;
        }
        return $this->make();
    }
315489
public void set(String name, Object o){
        Map<String,Object> m = getMap(name);
        if(m!=null) {
            memoryHeap.release(m.get(name));
            m.put(name, o);
            memoryHeap.take(m.get(name));
        }
    }
1232608
function (mapName, object) {
            var mapFunction = this.mapFunctions[mapName],
                index,
                value,
                emit = function (idx, val) {
                    index = idx;
                    value = val;
                };

            mapFunction.call(object, object, emit);

            if (this.maps[mapName][index] === undefined) {
                this.maps[mapName][index] = [];
            }
            this.maps[mapName][index].push(value);
            this.mapValues[object.id][mapName] = index;
            return this;
        }
3107
public function addProperty($name, callable $factory, $memoize = false)
    {
        $this->properties[$name] = ['factory' => \Closure::bind($factory, $this, $this), 'memoize' => $memoize];

        return $this;
    }
563338
public Object get(String name, ObjectFactory<?> factory) {
		ThreadScopeContext context = ThreadScopeContextHolder.getContext();

		Object result = context.getBean(name);
		if (null == result) {
			result = factory.getObject();
			context.setBean(name, result);
		}
		return result;
	}
1105436
public synchronized void setFactoryMethod(String factoryMethodName)
    {
        Method newMethod = null;
        this.factoryMethodName = factoryMethodName;

        if (factoryMethodName != null)
        {
            try
            {
                // see if we have a publicly accessible method by the name
                newMethod = getFactoryClass().getMethod(factoryMethodName, NO_PARAMS);
            }
            catch (NoSuchMethodException e)
            {
                try
                {
                    // no publicly accessible method, see if there is a private/protected one
                    newMethod = getFactoryClass().getDeclaredMethod(factoryMethodName, NO_PARAMS);
                }
                catch (NoSuchMethodException e2)
                {
                    // there is no such method available
                    throw new MetadataException(
                        "Invalid factory method, there is not"
                            + " a zero argument method named "
                            + factoryMethodName
                            + " on class "
                            + getFactoryClass().getName()
                            + ".");
                }
            }
        }
        setFactoryMethod(newMethod);
    }
456094
def set_factory(self, thing: type, value, overwrite=False):
        
        if thing in self.factories and not overwrite:
            raise DiayException('factory for %r already exists' % thing)
        self.factories[thing] = value
1210884
public Response andContent(String name, Object object) {
        Objects.requireNonNull(name, Required.NAME.toString());
        this.content.put(name, object);

        return this;
    }
1325825
public DeploymentInfo addAuthenticationMechanism(final String name, final AuthenticationMechanismFactory factory) {
        authenticationMechanisms.put(name.toUpperCase(Locale.US), factory);
        return this;
    }
1374816
public synchronized Object put(Object name,Object value)
    {
        if (_initParams==null)
            _initParams=new HashMap(3);
        return _initParams.put(name,value);
    }
681738
function Injector(obj){
  var services = {};
  var get = name => {
    if(!(name in services)){
      const err = new Error(`[injector] service "${name}" not found`);
      return Promise.reject(err);
    }
    return services[name];
  };
  if(typeof obj === 'object')
    services = obj;
  if(typeof obj === 'function')
    get = obj;
  function resolve(name) {
    let service = get(name);
    if(typeof service === 'function')
      service = invoke(service);
    return service;
  };
  function invoke(fn, that){
    return Promise
    .all(getParameterNames(fn).map(resolve))
    .then(params => fn.apply(that, params));
  }
  return invoke;
}
346352
public static function set(&$object, $name, $value)
    {
        $names = explode('.', $name);
        $lastName = array_pop($names);
        $data = &$object;
        foreach ($names as $nameItem)
        {
            if(is_array($data))
            {
                if (!isset($data[$nameItem]))
                {
                    $data[$nameItem] = [];
                }
                $data = &$data[$nameItem];
            }
            else if(is_object($data))
            {
                if (!isset($data->$nameItem))
                {
                    $data->$nameItem = new stdClass;
                }
                $data = &$data->$nameItem;
            }
        }
        if(is_array($data))
        {
            $data[$lastName] = $value;
        }
        else if(is_object($data))
        {
            $data->$lastName = $value;
        }
    }
910538
function(name) {
			var args = [].slice.call(arguments, 1);
			var factory = this.get(name);
			return factory ? factory.apply(this, args) : null;
		}