Create a new entity.

        The entity will have a higher UID than any previously associated
        with this world.

        :return: the new entity
        :rtype: :class:`essence.Entity`
557666
def create_entity(self):
        """"""
        self._highest_id_seen += 1
        entity = Entity(self._highest_id_seen, self)
        self._entities.append(entity)
        return entity
956466
def request_entity_create(self, lid, epId=None):
        
        lid = Validation.lid_check_convert(lid)
        if epId is None:
            epId = self.__epId
        elif epId is False:
            epId = None
        else:
            epId = Validation.guid_check_convert(epId)
        logger.debug("request_entity_create lid='%s'", lid)
        return self._request(R_ENTITY, C_CREATE, None, {'epId': epId, 'lid': lid}, is_crud=True)
212687
function create_new() {
        var id

        // Check if we already have an id or if
        // we need to generate a new one.
        if (undefined !== ent.id$) {
          // Take a copy of the existing id and
          // delete it from the ent object. Do
          // save will handle the id for us.
          id = ent.id$
          delete ent.id$

          // Save with the existing id
          return do_save(id, true)
        }

        // Generate a new id
        id = options.generate_id ? options.generate_id(ent) : void 0

        if (undefined !== id) {
          return do_save(id, true)
        } else {
          var gen_id = {
            role: 'basic',
            cmd: 'generate_id',
            name: name,
            base: base,
            zone: zone
          }

          // When we get a respones we will use the id param
          // as our entity id, if this fails we just fail and
          // call reply() as we have no way to save without an id
          seneca.act(gen_id, function(err, id) {
            if (err) return reply(err)
            do_save(id, true)
          })
        }
      }
74462
def create(self):
        

        # In the header.location there is the newly created object so get the id out of the url
        created_id = self._post_request(
            data=self.element_to_string(self.encode())
        ).headers.get('Location').split('/')[-1]
        return self.get(created_id)
795814
def put(self, entity):
    
    self._cur_batch.put(entity)
    self._num_mutations += 1
    if self._num_mutations >= MAX_MUTATIONS_IN_BATCH:
      self.commit()
      self.begin()
563194
def create(cls, parent, child, relation_type, index=None):
        """"""
        try:
            with db.session.begin_nested():
                obj = cls(parent_id=parent.id,
                          child_id=child.id,
                          relation_type=relation_type,
                          index=index)
                db.session.add(obj)
        except IntegrityError:
            raise Exception("PID Relation already exists.")
            # msg = "PIDRelation already exists: " \
            #       "{0} -> {1} ({2})".format(
            #         parent_pid, child_pid, relation_type)
            # logger.exception(msg)
            # raise Exception(msg)
        return obj
357685
def create(self):
        

        # Ensure that an existing document will not be "updated"
        doc = dict(self)
        if doc.get('_rev') is not None:
            doc.__delitem__('_rev')

        headers = {'Content-Type': 'application/json'}
        resp = self.r_session.post(
            self._database.database_url,
            headers=headers,
            data=json.dumps(doc, cls=self.encoder)
        )
        resp.raise_for_status()
        data = response_to_json_dict(resp)
        super(Document, self).__setitem__('_id', data['id'])
        super(Document, self).__setitem__('_rev', data['rev'])
868043
def new(cls, user, provider, federated_id):
        
        if cls.get_user(provider, federated_id):
            raise exceptions.AuthError("Federation already")

        return cls.create(user_id=user.id,
                          provider=provider,
                          federated_id=federated_id)
371318
def new() -> ulid.ULID:
    
    timestamp = int(time.time() * 1000).to_bytes(6, byteorder='big')
    randomness = os.urandom(10)
    return ulid.ULID(timestamp + randomness)
112978
def build(properties = {})
      entity = self.class.entity_class.new(:session => session)

      entity.update_properties(properties)
      entity.partial = false

      append(entity)
      initialize_properties_with_values_from_owner(entity)

      entity
    end
112557
def expand_entity(self, entity):
        
        if self.name in entity:
            return entity
        for key, value in entity.items():
            if isinstance(value, dict):
                if self.name in value:
                    return value
        raise KeyError("The field %s (%s) not found in %s" % (self.name, self._rule['type'], entity))
963718
public Entity newEntity(QualifiedName id) {
	Entity res = of.createEntity();
	res.setId(id);
	return res;
    }
1355829
def create(cls, uri, tlp_level=0, tags=[]):
        
        return cls._create(uri=uri, tlp_level=tlp_level, tags=tags)
732854
def create(self, **kwargs):
        
        model = self.new(**kwargs)
        return self.save(model)
1187986
async def get_entity(self):
        
        if not self.entity and await self.get_input_entity():
            try:
                self._entity =\
                    await self._client.get_entity(self._input_entity)
            except ValueError:
                pass

        return self._entity
352778
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('PD record already initialized!')

        self._initialized = True
        self.padding = b''
1084669
def create(self, model_obj):
        """"""
        # Update the value of the counters
        model_obj = self._set_auto_fields(model_obj)

        # Add the entity to the repository
        identifier = model_obj[self.entity_cls.meta_.id_field.field_name]
        with self.conn['lock']:
            self.conn['data'][self.schema_name][identifier] = model_obj

        return model_obj