Creates a new instance which will contain the given object. If an object with the same reference already exists,
it will be overridden by the new object.
351221
public function with(ObjectInterface $object): self
    {
        $clone = clone $this;
        $clone->objects[$object->getId()] = $object;
        $clone->array[$object->getId()] = $object->getInstance();

        return $clone;
    }
238271
function createObject (val, type, name) {
  if (!val || ref.isNull(val)) return null;

  var cache = objc.objc_getAssociatedObject(val, objc.objcStorageKey);
  if (!ref.isNull(cache)) return cache.readObject(0);

  var instance = (type == '@') ? new (require('./id'))(val)
                        : new (require('./class'))(val);

  // store this ID JS reference into the Obj-C internal associated object store
  var refn = ref.alloc('pointer');
  refn.writeObject(instance, 0);
  objc.objc_setAssociatedObject(val, objc.objcStorageKey, refn, 0);

  return instance;
}
103680
def create(self, instance):
        
        with self.flushing():
            if instance.id is None:
                instance.id = self.new_object_id()
            self.session.add(instance)
        return instance
877193
@Override
	public Object create(Object locator) throws CreateException {
		for (Registration registration : _registrations) {
			if (registration.getLocator().equals(locator)) {
				try {
					return registration.getFactory().create(locator);
				} catch (Exception ex) {
					if (ex instanceof CreateException)
						throw (CreateException) ex;

					throw (CreateException) new CreateException(null, "Failed to create object for " + locator)
							.withCause(ex);
				}
			}
		}
		return null;
	}
700046
public void savePersistentObject(PersistentObject object) {
        final String type = object.getClass().getSimpleName();
        LOG.trace("Trying to create a new " + type);
        dao.saveOrUpdate(object);
        LOG.info("Created the " + type + " with id " + object.getId());
    }
1364394
public static Object createObject(String classname) throws ParseException
    {
        Class<?> cl;

        try
        {
            cl = Class.forName(classname);
        }
        catch (ClassNotFoundException cnfe)
        {
            throw new ParseException("Unable to find the class: " + classname);
        }
        
        try
        {
            return cl.newInstance();
        }
        catch (Exception e)
        {
            throw new ParseException(e.getClass().getName() + "; Unable to create an instance of: " + classname);
        }
    }
981541
def add_object(self, obj):
        

        # delegate to SchemaType object
        schema_generator = self._get_generator_for_object(obj)
        schema_generator.add_object(obj)

        # return self for easy method chaining
        return self
1316967
def new(self, name, *args, **kwargs):
        '''
        '''
        if name in self._instance_map:
            raise ValueError('Instance {0} is already initialized'
                             .format(name))

        instance = self._class_map[name](*args, **kwargs)
        self._instance_map[name] = instance
        return instance
165022
def create_object(cls, members):
    """"""
    obj = cls.__new__(cls)
    obj.__dict__ = members
    return obj
106933
def clone(self, new_object):
        
        return self.__class__(new_object, self.method, self.name)
991239
@Help(help = "Create the object of type {#}")
  public T create(final T object) throws SDKException {
    return (T) requestPost(object);
  }
1212821
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof PlaceDescription)){
    return new PlaceDescription(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(PlaceDescription.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
868613
function create(object, callback) {
    self.emit('create', object)
    callback = callback || emptyFn
    // clone the object
    var extendedObject = extend({}, object)

    if (!extendedObject[options.idProperty]) {
      idSeq += 1
      extendedObject[options.idProperty] = '' + idSeq
    } else {
      if (findById(extendedObject[options.idProperty]) !== null) {
        return callback(new Error('Key ' + extendedObject[options.idProperty] + ' already exists'))
      }
      // if an id is provided, cast to string.
      extendedObject[options.idProperty] = '' + extendedObject[options.idProperty]
    }
    data.push(extend({}, extendedObject))
    self.emit('afterCreate', extendedObject)
    callback(undefined, extendedObject)
  }
126810
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof PlaceReference)){
    return new PlaceReference(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(GedcomX.ExtensibleData.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
872607
public <RET extends Object> RET newInstance(final String iClassName) {
		checkSecurity(ODatabaseSecurityResources.CLASS, ORole.PERMISSION_CREATE, iClassName);

		try {
			return (RET) entityManager.createPojo(iClassName);
		} catch (Exception e) {
			OLogManager.instance().error(this, "Error on creating object of class " + iClassName, e, ODatabaseException.class);
		}
		return null;
	}
976404
def create(cls, class_name, **attributes):
        
        object_class = cls.extend(class_name)
        return object_class(**attributes)
90758
@Override
	public Object getObjectInstance(Object obj, Name name, Context context, Hashtable<?,?> environment) throws Exception
	{
		if (!(obj instanceof Reference))
			throw new IllegalStateException("Object is not a reference : "+obj);
		
        Reference reference = (Reference)obj;
        String objClassName = reference.getClassName();
        
        // Queue
        if (objClassName.equals(QueueRef.class.getName()))
        {
        	String queueName = getRequiredAttribute(reference, "queueName");
        	return new QueueRef(queueName);
        }
        
        // Topic
        if (objClassName.equals(TopicRef.class.getName()))
        {
        	String topicName = getRequiredAttribute(reference, "topicName");
        	return new TopicRef(topicName);
        }
        
        // ConnectionFactory
        if (objClassName.equals(FFMQConnectionFactory.class.getName()))
        	return new FFMQConnectionFactory(recreateConnectionFactoryEnv(reference));
        
        // QueueConnectionFactory
        if (objClassName.equals(FFMQQueueConnectionFactory.class.getName()))
        	return new FFMQQueueConnectionFactory(recreateConnectionFactoryEnv(reference));
        
        // TopicConnectionFactory
        if (objClassName.equals(FFMQTopicConnectionFactory.class.getName()))
        	return new FFMQTopicConnectionFactory(recreateConnectionFactoryEnv(reference));

        // We don't know how to handle this
        return null; 
	}