Create a new has one instance.
482769
function HasOne(model, related, foreignKey, localKey) {
        var _this = _super.call(this, model) /* istanbul ignore next */ || this;
        _this.related = _this.model.relation(related);
        _this.foreignKey = foreignKey;
        _this.localKey = localKey;
        return _this;
    }
396802
function _new (args) {
    // instantiate new instance
    var instance = new ImmutableCoreComponentInstance({
        args: args,
        component: this,
    })
    // wait for initialize promise to resolve then resolve with instance
    return instance.promise.then(() => instance)
}
943555
def new(self, init=None):
        """"""
        if self.count >= self.size:
            self.resize(self.count * 2)
        chunk = self.get(self.count)
        if init is not None:
            assert len(init) == self.chunk_size
            chunk[0:self.chunk_size] = init
        self.count += 1
        return chunk
101600
def seed_instance(self, seed=None):
        """"""
        if self.__random == random:
            # create per-instance random obj when first time seed_instance() is
            # called
            self.__random = random_module.Random()
        self.__random.seed(seed)
        return self
284391
public static <T> T newInstance(String name) {
        try {
            return (T) getClass(name).newInstance();
        } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }
1051547
def instance(cls, *args, **kwgs):
        """"""
        if not hasattr(cls, "_instance"):
            cls._instance = cls(*args, **kwgs)
        return cls._instance
73556
private static Object newInstance(String className,
                                      ClassLoader classLoader,
                                      Properties properties)
    {
        try {
            Class<?> spiClass;
            if (classLoader == null) {
                spiClass = Class.forName(className);
            } else {
                spiClass = classLoader.loadClass(className);
            }
            if (properties != null) {
                Constructor constr = null;
                try {
                    constr = spiClass.getConstructor(Properties.class);
                } catch (Exception ex) {
                }
                if (constr != null) {
                    return constr.newInstance(properties);
                }
            }
            return spiClass.newInstance();
        } catch (ClassNotFoundException x) {
            throw new ELException(
                "Provider " + className + " not found", x);
        } catch (Exception x) {
            throw new ELException(
                "Provider " + className + " could not be instantiated: " + x,
                x);
        }
    }
1238393
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('CL record already initialized!')

        self.child_log_block_num = 0  # This gets set later

        self._initialized = True
611515
def create(self, **kwargs):
        """"""
        resp = self.client.create(url=self.base_url,
                                  json=kwargs)
        return resp
403921
public static <T> T newInstance(Class<T> clazz) {
		try {
			return clazz.newInstance();
		}
		catch (InstantiationException | IllegalAccessException e) {
			throw new ResourceException(String.format("couldn't create a new instance of %s", clazz));
		}
	}
1052661
def CreateInstance(self, *args, **kwargs):
        

        inst = args[0] if args else kwargs['NewInstance']
        try:
            self.instances[self.default_namespace].append(inst)
        except KeyError:
            self.instances[self.default_namespace] = [inst]
        return inst.path
286810
public Object newInstance( String name, Object... params ) throws ClassLoaderException {
        return newInstance( name, params, null );
    }
16256
def _create_one(self, ctx):
        
        assert isinstance(ctx, ResourceQueryContext)

        fields = dict_pick(ctx.data, self._model_columns)
        model = self.model_cls(**fields)
        return model
100741
public static Requirement newInstance(String name)
    {
        Requirement requirement = new Requirement();
        requirement.setName(name);
        return requirement;
    }
928426
protected function newCountInstance()
    {
        $instance = new static(
            $this->getFilePath(),
            $this->getFilesystem(),
            $this->getDetector(),
            clone $this->getLineReader()
        );
        return $instance->setDelimiter($this->getDelimiter())
                        ->setSeparator($this->getSeparator())
                        ->setHeader($this->getHeader());
    }
592162
def new_(self, df=pd.DataFrame(), db=None, quiet=False,
             nbload_libs=True):
        
        ds2 = Ds(df, db, nbload_libs)
        if quiet is False:
            self.ok("A new instance was created")
        return ds2
214582
@Override
    public Mp newInstance() throws DempsyException {
        try {
            return newMp.get();
        } catch(final RuntimeException rte) {
            throw new DempsyException(rte, true);
        }
    }