Can be used as an id attribute for anchor destination in HTML.
 Will return "#{prefix}_#{index}" -- if prefix is missing,
 will use #engine_id if present. If both are missing, returns nil.
 if index missing, returns nil.
428379
def html_id(prefix, index)
      prefix = prefix || self.engine_id
      prefix, index = prefix.to_s, index.to_s

      return nil if index.empty?
      return nil if prefix.empty?

      return "#{prefix}_#{index}"
    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
1366447
def get_attribute_name_id(attr):
    
    return attr.value.id if isinstance(attr.value, ast.Name) else None
1131467
def get_id(self):
        """"""
        if self._id_attr is None or not hasattr(self, self._id_attr):
            return None
        return getattr(self, self._id_attr)
358812
def find_by_prefix(prefix)
      @machines.each do |uuid, data|
        return data.merge("id" => uuid) if uuid.start_with?(prefix)
      end

      nil
    end
315729
protected String getId(FaceletContext ctx)
    {
        if (this.id != null)
        {
            return this.id.getValue(ctx);
        }
        return ctx.generateUniqueId(this.tagId);
    }
482420
public String getId() {
		if(id == null) {
			synchronized(lock) {
				if(id == null) {
					if(page != null) {
						Map<String,Element> elementsById = page.getElementsById();
						// Generate the ID now
						String template = getElementIdTemplate();
						if(template == null) {
							throw new IllegalStateException("null from getElementIdTemplate");
						}
						StringBuilder possId = Element.generateIdPrefix(template, getDefaultIdPrefix());
						int possIdLen = possId.length();
						// Find an unused identifier
						for(int i=1; i<=Integer.MAX_VALUE; i++) {
							if(i == Integer.MAX_VALUE) throw new IllegalStateException("ID not generated");
							if(i>1) possId.append('-').append(i);
							String newId = possId.toString();
							if(
								elementsById == null
								|| !elementsById.containsKey(newId)
							) {
								setId(newId, true);
								break;
							}
							// Reset for next element number to check
							possId.setLength(possIdLen);
						}
					}
				}
			}
		}
		return id;
	}
265666
def id_fix(value):
    
    if value.startswith('KSC_M'):
        pass
    else:
        value = value.replace(':','_')
        if value.startswith('ERO') or value.startswith('OBI') or value.startswith('GO') or value.startswith('UBERON') or value.startswith('IAO'):
            value = 'obo:' + value
        elif value.startswith('birnlex') or value.startswith('nlx'):
            value = 'NIFSTD:' + value
        elif value.startswith('MESH'):
            value = ':'.join(value.split('_'))
        else:
            value = ':' + value

    return OntId(value).URIRef
463696
def get_id(page):
  
  start_pos = page.find("<id>")
  end_pos = page.find("</id>")
  assert start_pos != -1
  assert end_pos != -1
  start_pos += len("<id>")
  return int(page[start_pos:end_pos])
288687
def _unique_id(self, prefix):
        
        _id = self._id_gen
        self._id_gen += 1
        return prefix + str(_id)
525786
def get_node_id(edge, node_type):
    
    assert node_type in ('source', 'target')
    _, node_id_str = edge.attrib[node_type].split('.')  # e.g. //@nodes.251
    return int(node_id_str)
1100727
def extract_prefix_attr(cls, req):
        

        # TODO: add more?
        attr = {}
        if 'id' in req:
            attr['id'] = int(req['id'])
        if 'prefix' in req:
            attr['prefix'] = req['prefix']
        if 'pool' in req:
            attr['pool_id'] = int(req['pool'])
        if 'node' in req:
            attr['node'] = req['node']
        if 'type' in req:
            attr['type'] = req['type']
        if 'country' in req:
            attr['country'] = req['country']
        if 'indent' in req:
            attr['indent'] = req['indent']

        return attr
115706
function(id_string) {

		id_string = id_string.trim();
		var match = this._locator_regex.exec(id_string),
			result;

		if (!match || match[2].indexOf('$') != -1) Lava.t("Malformed resource id: " + id_string);

		/** @type {_cResourceId} */
		result = {
			locator_type: this.locator_types[id_string[0]],
			locator: match[1],
			name: match[2]
		};

		return result;

	}
905001
def get(self, interface_id):
        
        # From within engine, skips nested iterators for this find
        # Make sure were dealing with a string
        interface_id = str(interface_id)
        for intf in self:
            if intf.interface_id == interface_id:
                intf._engine = self.engine
                return intf
            else: # Check for inline interfaces
                if '.' in interface_id:
                    # It's a VLAN interface
                    vlan = interface_id.split('.')
                    # Check that we're on the right interface
                    if intf.interface_id == vlan[0]:
                        if intf.has_vlan:
                            return intf.vlan_interface.get_vlan(vlan[-1])

                elif intf.has_interfaces:
                    for interface in intf.interfaces:
                        if isinstance(interface, InlineInterface):
                            split_intf = interface.nicid.split('-')
                            if interface_id == interface.nicid or \
                                str(interface_id) in split_intf:
                                intf._engine = self.engine
                                return intf

        raise InterfaceNotFound(
            'Interface id {} was not found on this engine.'.format(interface_id))
914056
def lookup_variable(var, prefix=nil)

      var, prefix = split_prefix(var, prefix)

      if prefix == '//'
        return @context.storage.get_engine_variable(var)
      end

      if prefix == '/' && par = parent
        return par.lookup_variable(var, prefix)
      end

      if h.variables and Ruote.has_key?(h.variables, var)
        return Ruote.lookup(h.variables, var)
      end

      if h.parent_id && h.parent_id['engine_id'] == @context.engine_id
        #
        # do not lookup variables in a remote engine ...

        (return parent.lookup_variable(var, prefix)) rescue nil
          # if the lookup fails (parent gone) then rescue and let go
      end

      k = var.split('.').first
      vars = { k => @context.storage.get_engine_variable(k) }
        #
        # engine var lookup might be expensive, only lookup the var we need

      Ruote.lookup(vars, var)
    end
135981
def id(self):
        """"""
        id = ''
        if (self.server_and_prefix is not None and
                self.server_and_prefix != ''):
            id += self.server_and_prefix + '/'
        if (self.identifier is not None):
            id += self.identifier
        return id
465104
@Override
    public String getId(Map<String, Object> context) {
        String id = null;

        if (isMultiplexWithAddress()) {
            String address = (String) context.get(Message.PATH_INFO);
            if (null != address) {
                int afterLastSlashIndex = address.lastIndexOf("/") + 1;
                if (afterLastSlashIndex > 0
                    && afterLastSlashIndex < address.length()) {
                    id = address.substring(afterLastSlashIndex);
                }
            } else {
                getLogger().log(Level.WARNING,
                                new org.apache.cxf.common.i18n.Message("MISSING_PATH_INFO", tc.getLogger()).toString());
            }
        } else {
            return super.getId(context);
        }
        return id;
    }