Get the prefix with id 'id'.
976635
def get(cls, id):
        

        # cached?
        if CACHE:
            if id in _cache['Prefix']:
                log.debug('cache hit for prefix %d' % id)
                return _cache['Prefix'][id]
            log.debug('cache miss for prefix %d' % id)

        try:
            prefix = Prefix.list({'id': id})[0]
        except IndexError:
            raise NipapNonExistentError('no prefix with ID ' + str(id) + ' found')

        _cache['Prefix'][id] = prefix
        return prefix
804561
def company_prefix(self):
        """"""
        offset = self.EXTRA_DIGITS
        return self._id[offset:self._ref_idx]
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
787173
def _get_id(self):
        """"""
        ret = None
        row = self.row
        if row:
            ret = row["id"]
        return ret
71323
function getUID(prefix) {
  do {
    // eslint-disable-next-line no-bitwise
    prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  } while (document.getElementById(prefix));

  return prefix;
}
884612
def t_ID(self, t):
        '

        if t.value[0] == '~':
            t.type = 'TYVAR'
            t.value = t.value[1:]
        elif t.value in self.reserved_words:
            t.type = self.reserved_words[t.value]
        else:
            t.type = 'ID'

        return t
800520
def get_prefix(self, key_prefix, sort_order=None, sort_target=None):
        
        return self.get(key_prefix,
                        metadata=True,
                        range_end=_encode(_increment_last_byte(key_prefix)),
                        sort_order=sort_order,
                        sort_target=sort_target)
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)
1173816
def get_ids_with_prefix(portal_type, prefix):
    
    brains = search_by_prefix(portal_type, prefix)
    ids = map(api.get_id, brains)
    return ids
233521
public static String getShortID(String id) {
        String canonicalID = getCanonicalCLDRID(id);
        if (canonicalID == null) {
            return null;
        }
        return getShortIDFromCanonical(canonicalID);
    }
685726
def uniqueId(self, prefix=""):
        
        _IdCounter.count += 1
        id = _IdCounter.count
        if prefix:
            return self._wrap(prefix + str(id))
        else:
            return self._wrap(id)
1106379
protected function _idToFileName($id)
    {
        $instance = self::getInstance();
        $prefix = $instance->_options['file_name_prefix'];
        return $prefix . '---' . $id;
    }
209659
private String deriveId(final String idName) {
		// Find parent naming context
		NamingContextable parent = WebUtilities.getParentNamingContext(this);

		// No Parent
		if (parent == null) {
			return idName;
		}

		// Get ID prefix
		String prefix = parent.getNamingContextId();

		// No Prefix, just use id name
		if (prefix.length() == 0) {
			return idName;
		}

		// Add Prefix
		StringBuffer nameBuf = new StringBuffer(prefix.length() + idName.length() + 1);
		nameBuf.append(prefix);
		nameBuf.append(ID_CONTEXT_SEPERATOR);
		nameBuf.append(idName);

		return nameBuf.toString();
	}
1114449
def get_suffix(id, regex="-[A-Z]{1}[0-9]{1,2}$"):
    
    parts = re.findall(regex, id)
    if not parts:
        return ""
    return parts[0]
815914
def get_prefixes(self, ns_uri):
        """"""
        ni = self.__lookup_uri(ns_uri)
        return ni.prefixes.copy()
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
1341925
def get_prefix(self):
        """"""
        prefix = self.bucket
        if self.prefix:
            prefix += self.delimiter + self.prefix
        return prefix