Mint record identifiers.

    :param record_uuid: The record UUID.
    :param data: The record data.
    :returns: A :class:`invenio_pidstore.models.PersistentIdentifier` instance.
963368
def oaiid_minter(record_uuid, data):
    
    pid_value = data.get('_oai', {}).get('id')
    if pid_value is None:
        fetcher_name = \
            current_app.config.get('OAISERVER_CONTROL_NUMBER_FETCHER', 'recid')
        cn_pid = current_pidstore.fetchers[fetcher_name](record_uuid, data)
        pid_value = current_app.config.get('OAISERVER_ID_PREFIX', '') + str(
            cn_pid.pid_value
        )
    provider = OAIIDProvider.create(
        object_type='rec', object_uuid=record_uuid,
        pid_value=str(pid_value)
    )
    data.setdefault('_oai', {})
    data['_oai']['id'] = provider.pid.pid_value
    return provider.pid
1240631
def getbyuuid(self, uuid):
        
        if uuid not in self._schbyuuid:
            raise KeyError('uuid {0} not registered'.format(uuid))

        return self._schbyuuid[uuid]
36872
def update_record(self, identifier, rtype=None, name=None, content=None, **kwargs):
        
        if not rtype and kwargs.get('type'):
            warnings.warn('Parameter "type" is deprecated, use "rtype" instead.',
                          DeprecationWarning)
            rtype = kwargs.get('type')

        return self._update_record(identifier, rtype=rtype, name=name, content=content)
720863
def update_subject_identifier_on_save(self):
        
        if not self.subject_identifier:
            self.subject_identifier = self.subject_identifier_as_pk.hex
        elif re.match(UUID_PATTERN, self.subject_identifier):
            pass
        return self.subject_identifier
318994
def uuid(dataset_uri):
    """"""
    dataset = dtoolcore.DataSet.from_uri(dataset_uri)
    click.secho(dataset.uuid)
93583
def uuid(cls):
        """"""
        if hasattr(cls, '__uuid_primary_key__') and cls.__uuid_primary_key__:
            return synonym('id')
        else:
            return immutable(Column(UUIDType(binary=False), default=uuid_.uuid4, unique=True, nullable=False))
1363515
def get_entity_uuid_coords(self, uuid):
        
        if uuid in self._entity_to_region_map:
            coords = self._entity_to_region_map[uuid]
            entities = self.get_entities(*coords)
            for entity in entities:
                if 'uniqueId' in entity.data and entity.data['uniqueId'] == uuid:
                    return tuple(entity.data['tilePosition'])
        return None
975602
def identify(label, column_type = :integer)
      if column_type == :uuid
        NamedSeeds.uuid_v5(label)
      else
        Zlib.crc32(label.to_s) % MAX_ID
      end
    end
1200778
def uuid(self):
		
		uuid_file = '/sys/block/%s/dm/uuid' % os.path.basename(os.path.realpath(self.volume_path()))
		lv_uuid = open(uuid_file).read().strip()
		if lv_uuid.startswith('LVM-') is True:
			return lv_uuid[4:]
		return lv_uuid
163281
public ORID getIdentity(final Object iPojo) {
		final ODocument record = getRecordByUserObject(iPojo, false);
		if (record == null)
			throw new OObjectNotManagedException("The object " + iPojo + " is not managed by current database");

		return record.getIdentity();
	}
959819
def uuid(self):
        '''
        '''
        pk = self.pkvalue()
        if not pk:
            raise self.DoesNotExist(
                'Object not saved. Cannot obtain universally unique id')
        return self.get_uuid(pk)
1354930
def post_generate_identifier(request):
    """"""
    d1_gmn.app.views.assert_db.post_has_mime_parts(request, (('field', 'scheme'),))
    if request.POST['scheme'] != 'UUID':
        raise d1_common.types.exceptions.InvalidRequest(
            0, 'Only the UUID scheme is currently supported'
        )
    fragment = request.POST.get('fragment', None)
    while True:
        pid = (fragment if fragment else '') + uuid.uuid4().hex
        if not d1_gmn.app.models.ScienceObject.objects.filter(pid__did=pid).exists():
            return pid
474926
def _list_records_internal(self, identifier=None, rtype=None, name=None, content=None):
        """"""
        response = self._request_get_dns_zone()
        if 'records' in response:
            # Interpret empty string as None because zeep does so too
            content_check = content if content != "" else None
            name_check = self._relative_name(name)

            # Stringize the identifier to prevent any rtype differences
            identifier_check = str(
                identifier) if identifier is not None else None

            filtered_records = [
                record for record in response['records'] if (
                    identifier is None or str(
                        record['id']) == identifier_check) and (
                            rtype is None or record['type'] == rtype) and (
                                name is None or record['name'] == name_check) and (
                                    content is None or (
                                        'content' in record
                                        and record['content'] == content_check))]
            records = [self._create_response_record(
                filtered_record) for filtered_record in filtered_records]
        else:
            records = []
        return records
1332309
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF File Identifier Descriptor not initialized')

        if self.len_fi > 0:
            if self.encoding == 'latin-1':
                prefix = b'\x08'
            elif self.encoding == 'utf-16_be':
                prefix = b'\x10'
            else:
                raise pycdlibexception.PyCdlibInternalError('Invalid UDF encoding; this should not happen')

            fi = prefix + self.fi
        else:
            fi = b''
        rec = struct.pack(self.FMT, b'\x00' * 16, 1,
                          self.file_characteristics, self.len_fi,
                          self.icb.record(),
                          self.len_impl_use) + self.impl_use + fi + b'\x00' * UDFFileIdentifierDescriptor.pad(struct.calcsize(self.FMT) + self.len_impl_use + self.len_fi)
        return self.desc_tag.record(rec[16:]) + rec[16:]
1104839
def _get_matching_dns_entry_ids(self, identifier=None, rtype=None,
                                    name=None, content=None):
        """"""
        record_ids = []
        if not identifier:
            records = self._list_records(rtype, name, content)
            record_ids = [record['id'] for record in records]
        else:
            record_ids.append(identifier)
        return record_ids
1126952
def get_instance_for_uuid(self, uuid, project_id):
        
        instance_name = self._inst_info_cache.get((uuid, project_id))
        if instance_name:
            return instance_name
        instances = self._get_instances_for_project(project_id)
        for inst in instances:
            if inst.id.replace('-', '') == uuid:
                LOG.debug('get_instance_for_uuid: name=%s', inst.name)
                instance_name = inst.name
                self._inst_info_cache[(uuid, project_id)] = instance_name
                return instance_name
        return instance_name
120981
def RegisterRecordType(cls, record_class):
        

        record_type = record_class.MatchType()
        if record_type not in UpdateRecord.KNOWN_CLASSES:
            UpdateRecord.KNOWN_CLASSES[record_type] = []

        UpdateRecord.KNOWN_CLASSES[record_type].append(record_class)