Generates _id_map from _alternatives to allow validating contents
974290
def _setup(self):
        

        cls = self.__class__
        cls._id_map = {}
        cls._name_map = {}
        for index, info in enumerate(cls._alternatives):
            if len(info) < 3:
                info = info + ({},)
                cls._alternatives[index] = info
            id_ = _build_id_tuple(info[2], info[1])
            cls._id_map[id_] = index
            cls._name_map[info[0]] = index
687469
def _validate_id_types(self):
        ''''''

        for sequences in [self.uniparc_sequences, self.fasta_sequences, self.seqres_sequences, self.rosetta_sequences]:
            for chain_id, sequence in sequences.iteritems():
                sequence_id_types = set(map(type, sequence.ids()))
                if sequence_id_types:
                    assert(len(sequence_id_types) == 1)
                    assert(sequence_id_types.pop() == types.IntType)

        for chain_id, sequence in self.atom_sequences.iteritems():
            sequence_id_types = set(map(type, sequence.ids()))
            assert(len(sequence_id_types) == 1)
            sequence_id_type = sequence_id_types.pop()
            assert(sequence_id_type == types.StringType or sequence_id_type == types.UnicodeType)
709078
def _map(self, data_item):
        ""
        delegate = self.delegate
        logger.debug(f'mapping: {data_item}')
        if self.clobber or not self.exists(data_item.id):
            logger.debug(f'exist: {data_item.id}: {self.exists(data_item.id)}')
            delegate.dump(data_item.id, data_item)
714531
function (input, doNotGetIds) {
				var r = [];
				if (input) {
					if (typeof input == 'string') {
						if (input === "*") return input;
						r.push(input);
					}
					else {
						if (doNotGetIds) r = input;
						else {
							if (input.length) {
								for (var i = 0, j = input.length; i < j; i++)
									r.push(_info(input[i]).id);
							}
							else
								r.push(_info(input).id);
						}
					}
				}
				return r;
			}
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
725009
def propagate_ids(cls, obj, match_id, new_id, applied_keys, backend=None):
        
        applied = []
        def propagate(o):
            if o.id == match_id or (o.__class__.__name__ == 'DynamicMap'):
                setattr(o, 'id', new_id)
                applied.append(o)
        obj.traverse(propagate, specs=set(applied_keys) | {'DynamicMap'})

        # Clean up the custom tree if it was not applied
        if not new_id in Store.custom_options(backend=backend):
            raise AssertionError("New option id %d does not match any "
                                 "option trees in Store.custom_options."
                                 % new_id)
        return applied
1138840
function(params) {

                corbel.validate.value('id', this.id);

                var options = params ? corbel.utils.clone(params) : {};

                var args = corbel.utils.extend(options, {
                    url: this._buildUriWithDomain(this.id),
                    method: corbel.request.method.GET,
                    query: params ? corbel.utils.serializeParams(params) : null
                });

                return this.request(args);

            }
489006
def ids2strids(ids: Iterable[int]) -> str:
    
    return C.TOKEN_SEPARATOR.join(map(str, ids))
1234330
def generate_id
		
		title = children_to_s
		title.gsub!(/ /,'_')
		title.downcase!
		title.gsub!(/[^\w_]/,'')
		title.strip!
		
		if title.size == 0
			$uid ||= 0
			$uid += 1
			title = "id#{$uid}"
		end

		# random is a very bad idea
#		title << "_" + rand(10000).to_s
		title
	end
1224624
function(id) {
        if (typeof id !== "string") {
            YAHOO.log("id is not a string, assuming it is an HTMLElement");
            id = Dom.generateId(id);
        }
        this.invalidHandleIds[id] = id;
    }
225427
def validate(identifier):
    ''''''
    source = actions.validate_source(identifier)
    log.info('Source %s (%s) has been validated', source.slug, str(source.id))
731950
def _generate_id(self):
        
        name = self.name.replace(self.special_separator, "-").replace(".", "-")
        loc = "\/"
        if self.location:
            loc = self.location
        _id = "{PREFIX}{SEP}{NAME}{HASH}{SEP}".format(
            PREFIX=constants.CONU_ARTIFACT_TAG,
            NAME=name,
            HASH=hashlib.sha512(loc).hexdigest()[: 10],
            SEP=self.special_separator
        )
        return _id
267007
def to_representation(self, value):
        """"""
        content_type = ContentType.objects.get_for_id(value)
        return "_".join(content_type.natural_key())
1288418
def validate_id_or_name(record_name = nil)
      child_options = IdNameOptionsValidator.build_child_options(record_name)

      validate_options do
        any(*child_options).required
      end
    end
700577
def method_missing(id_or_class, *args, &block)
      if id_or_class.to_s =~ /(.*)!$/
        @attrs[:id] = $1
      else
        id = id_or_class
        @attrs[:class] = @attrs[:class] ? "#{@attrs[:class]} #{id}".strip : id
      end

      unless args.empty?
        if args.last.respond_to? :to_hash
          @attrs.merge! args.pop.to_hash
        end
      end

      args.push(@attrs)

      while @stream.length > @original_stream_length
        @stream.pop
      end

      if block
        @builder.tag! @sym, *args, &block
      else
        @builder.tag! @sym, *args
      end

      self
    end
256379
def span_with_id(span_id, options = {})
      if options && options[:index] then
        span(:id => span_id.to_s, :index => options[:index]).text
      else
        span(:id, span_id).text
      end
    end
1332028
def extract_identifier!(args)
      options = extract_options!(args)
      identifier = normalize_set_identifier(extract_environment!(options))
      args << options
      identifier
    end