Create new persistent identifier.
352345
def create(pid_type, pid_value, status, object_type, object_uuid):
    """"""
    from .models import PersistentIdentifier

    if bool(object_type) ^ bool(object_uuid):
        raise click.BadParameter('Speficy both or any of --type and --uuid.')

    new_pid = PersistentIdentifier.create(
        pid_type,
        pid_value,
        status=status,
        object_type=object_type,
        object_uuid=object_uuid,
    )
    db.session.commit()
    click.echo(
        '{0.pid_type} {0.pid_value} {0.pid_provider}'.format(new_pid)
    )
1288975
private void append2slowUUID() {
    if(_id != null)
      cancel_sparse();
    if( _ds==null && _ms!=null ) { // This can happen for columns with all NAs and then a UUID
      _xs=null;
      _ms.switchToLongs();
      _ds = MemoryManager.malloc8d(_sparseLen);
      Arrays.fill(_ms._vals8,C16Chunk._LO_NA);
      Arrays.fill(_ds,Double.longBitsToDouble(C16Chunk._HI_NA));
    }
    if( _ms != null && _sparseLen > 0 ) {
      _ds = MemoryManager.arrayCopyOf(_ds, _sparseLen * 2);
      _ms.resize(_sparseLen*2);
      if(_id != null) _id = Arrays.copyOf(_id,_sparseLen*2);
    } else {
      _ms = new Mantissas(4);
      _xs = null;
      _ms.switchToLongs();
      _ds = new double[4];
    }
  }
859727
def _make_persistent(self, model_name, pkg_name):
        """"""

        #
        # WARNING: ugly piece of monkey-patching below. Hopefully will replace
        # with native bravado-core code in the future...
        #

        # Load class at path pkg_name
        c = get_function(pkg_name)
        for name in ('load_from_db', 'save_to_db'):
            if not hasattr(c, name):
                raise PyMacaronCoreException("Class %s has no static method '%s'" % (pkg_name, name))

        log.info("Making %s persistent via %s" % (model_name, pkg_name))

        # Replace model generator with one that adds 'save_to_db' to every instance
        model = getattr(self.model, model_name)
        n = self._wrap_bravado_model_generator(model, c.save_to_db, pkg_name)
        setattr(self.model, model_name, n)

        # Add class method load_from_db to model generator
        model = getattr(self.model, model_name)
        setattr(model, 'load_from_db', c.load_from_db)
607763
def _create_symbol(self, id, symbolobj):
        """"""
        result = {'id': symbolobj.name, 'isPoint': False, 'isStroke': False, 'isFill': False}
        matcher = Mapfile._SYMBOL_NAME_REGEXP.match(symbolobj.name)
        if matcher:
            result['name'] = matcher.group(2)
            for c in matcher.group(1):
                field = Mapfile._STYLE_CHAR2NAME[c]
                result[field] = True
        else:
            result['name'] = symbolobj.name
            result['isPoint'] = result['isStroke'] = result['isFill'] = True
        return result
1205804
def _update_record_with_id(self, identifier, rtype, content):
        """"""
        record = self._create_request_record(identifier, rtype, None, content,
                                             self._get_lexicon_option('ttl'),
                                             self._get_lexicon_option('priority'))

        self._request_modify_dns_record(record)
1290677
def create_identity(user_id, curve_name):
    """"""
    result = interface.Identity(identity_str='gpg://', curve_name=curve_name)
    result.identity_dict['host'] = user_id
    return result
1329788
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Terminating Descriptor already initialized')

        self.desc_tag = UDFTag()
        self.desc_tag.new(8)  # FIXME: we should let the user set serial_number

        self._initialized = True
1311256
def create(self, fname, lname, group, type, group_api):
        """"""
        self.__username(fname, lname)
        self.client.add(
            self.__distinguished_name(type, fname=fname, lname=lname),
            API.__object_class(),
            self.__ldap_attr(fname, lname, type, group, group_api))
808116
def create_id(self, prefix="guid"):
        
        if self.method == IDGenerator.METHOD_UUID:
            id_ = str(uuid.uuid4())
        elif self.method == IDGenerator.METHOD_INT:
            id_ = self.next_int
            self.next_int += 1
        else:
            raise InvalidMethodError(self.method)

        return "%s:%s-%s" % (self.namespace.prefix, prefix, id_)
224938
def _create_identifier(rdtype, name, content):
        
        sha256 = hashlib.sha256()
        sha256.update((rdtype + '/').encode('UTF-8'))
        sha256.update((name + '/').encode('UTF-8'))
        sha256.update(content.encode('UTF-8'))
        return sha256.hexdigest()[0:7]
1203297
def generate_new_id(self):
        
        self.events.append(Event())
        indiv_id = self.indiv_counter
        self.indiv_counter += 1
        return indiv_id
564341
def cli(env, identifier):
    """"""

    mgr = SoftLayer.ObjectStorageManager(env.client)
    credential_limit = mgr.limit_credential(identifier)
    table = formatting.Table(['limit'])
    table.add_row([
        credential_limit,
    ])

    env.fout(table)
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());
    }
1755
def _create(self):
        """"""
        if not os.path.exists(settings.SALMON_WHISPER_DB_PATH):
            os.makedirs(settings.SALMON_WHISPER_DB_PATH)
        archives = [whisper.parseRetentionDef(retentionDef)
                    for retentionDef in settings.ARCHIVES.split(",")]
        whisper.create(self.path, archives,
                       xFilesFactor=settings.XFILEFACTOR,
                       aggregationMethod=settings.AGGREGATION_METHOD)
535362
def generate_new_cid(upstream_cid=None):
    """"""
    if upstream_cid is None:
        return str(uuid.uuid4()) if getattr(settings, 'CID_GENERATE', False) else None
    if (
            getattr(settings, 'CID_CONCATENATE_IDS', False)
            and getattr(settings, 'CID_GENERATE', False)
    ):
        return '%s, %s' % (upstream_cid, str(uuid.uuid4()))
    return upstream_cid
187971
private void append2slowUUID() {
    final int CHUNK_SZ = 1 << H2O.LOG_CHK;
    if( _sparseLen > CHUNK_SZ )
      throw new ArrayIndexOutOfBoundsException(_sparseLen);
    if( _ds==null && _ls!=null ) { // This can happen for columns with all NAs and then a UUID
      _xs=null;
      alloc_doubles(_sparseLen);
      Arrays.fill(_ls,C16Chunk._LO_NA);
      Arrays.fill(_ds,Double.longBitsToDouble(C16Chunk._HI_NA));
    }
    if( _ls != null && _ls.length > 0 ) {
      _ls = MemoryManager.arrayCopyOf(_ls,_sparseLen<<1);
      _ds = MemoryManager.arrayCopyOf(_ds,_sparseLen<<1);
    } else {
      alloc_mantissa(4);
      alloc_doubles(4);
    }
    assert _sparseLen == 0 || _ls.length > _sparseLen:"_ls.length = " + _ls.length + ", _sparseLen = " + _sparseLen;
  }
1212464
private void refreshId()
	{
		if (null == getName())
		{
			setId(null);
		}
		else
		{
			if (null == getIdSuffix())
			{
				setId(getName());
			}
			else
			{
				setId(getName() + getIdSuffix());
			}
		}
	}