Resolves the ID of the language in which the response must be drafted.
10760
private function resolveLanId(): void
  {
    $codes = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? null);

    // If HTTP_ACCEPT_LANGUAGE is not set or empty return the default language.
    if (empty($codes)) $this->lanIdDefault;

    $map = Abc::$babel->getInternalLanguageMap();

    // Try to find the language code. Examples: en, en-US, zh, zh-Hans.
    // BTW We assume HTTP_ACCEPT_LANGUAGE is sorted properly.
    foreach ($codes as &$code)
    {
      // The official language code for Dutch in the Netherlands is nl-NL (with hyphen). But in practice we encounter
      // nl_NL, nl_nl, nl-nl. Therefore, internal language codes are in lower case and with hyphen.

      // Remove sorting weight, replace underscore with dash, and convert to lower case.
      $code = strtolower(str_replace('_', '-', strtok($code, ';')));

      if (isset($map[$code]))
      {
        $this->lanId = $map[$code];

        return;
      }
    }

    // We did not find the language code. Try without county code. Examples: en, zh.
    foreach ($codes as $code)
    {
      $code = substr($code, 0, 2);

      if (isset($map[$code]))
      {
        $this->lanId = $map[$code];

        return;
      }
    }

    // We did not find the language code. Use the ID of the default language.
    $this->lanId = $this->lanIdDefault;
  }
1177584
public static String id(String name, ClassDefinition appender, Map<String, String> appenderArgs, ClassDefinition layout, Map<String, String> layoutArgs, int level,
	    boolean readOnly) {
	StringBuilder sb = new StringBuilder(name).append(';').append(appender).append(';');
	toString(sb, appenderArgs);
	sb.append(';').append(layout).append(';');
	toString(sb, layoutArgs);
	sb.append(';').append(level).append(';').append(readOnly);

	return HashUtil.create64BitHashAsString(sb.toString(), Character.MAX_RADIX);
    }
628181
public function getLanguage($vocabulary_id, $language_id = null)
    {
        if (!$this->isTranslatable($vocabulary_id)) {
            return 1;
        }

        if ($language_id === null) {
            return I18N::getCurrentId();
        }

        return $language_id;
    }
469492
protected String resolveArtifactId() {
		if (this.artifactId != null) {
			return this.artifactId;
		}
		if (this.output != null) {
			int i = this.output.lastIndexOf('.');
			return (i != -1) ? this.output.substring(0, i) : this.output;
		}
		return null;
	}
994373
private String getMessageId(String response) {
		if (StringUtils.isNullOrEmptyTrimmed(response)) {
			return null;
		}

		try {
			MailGunSendResponse res = JsonUtils.fromJson(response, MailGunSendResponse.class);
			return res != null ? res.id : null;
		}
		catch (IllegalArgumentException e) {
			log.warn("Failed to parse MailGun send response: ", e);
			return null;
		}
	}
832231
private String identifier(boolean firstCanBeNumber) {
	if (!cfml.isCurrentLetter() && !cfml.isCurrentSpecial()) {
	    if (!firstCanBeNumber) return null;
	    else if (!cfml.isCurrentDigit()) return null;
	}
	boolean doUpper;
	PageSource ps = pc == null ? null : pc.getCurrentPageSource();
	if (ps != null) doUpper = !isJson && ps.getDialect() == CFMLEngine.DIALECT_CFML && ((MappingImpl) ps.getMapping()).getDotNotationUpperCase();
	else doUpper = !isJson && ((ConfigWebImpl) config).getDotNotationUpperCase(); // MUST .lucee should not be upper case

	StringBuilder sb = new StringBuilder();
	sb.append(doUpper ? cfml.getCurrentUpper() : cfml.getCurrent());
	do {
	    cfml.next();
	    if (!(cfml.isCurrentLetter() || cfml.isCurrentDigit() || cfml.isCurrentSpecial())) {
		break;
	    }

	    sb.append(doUpper ? cfml.getCurrentUpper() : cfml.getCurrent());
	}
	while (cfml.isValidIndex());
	return sb.toString();// cfml.substringLower(start,cfml.getPos()-start);
    }
721005
def _extract_id_from_batch_response(r, name='id'):
        """"""
        names = name + 's'
        if names in r:
            # soon-to-be deprecated batch reponse
            if 'errors' in r and r['errors']:
                raise GeneralException(r['errors'][0]['desc'])
            id = r[names][0]
        else:
            # new-style simplified api response
            id = r[name]
        return int(id)
976067
public Selector resolve(Identifier id, PositionAssigner positionAssigner) {
    positionAssigner.assign(id);
    return id;
  }
103511
public static String resolve( String lang ) {

		String result;
		if( ! LANGUAGES.contains( lang ))
			result = EN;
		else
			result = lang;

		return result;
	}
108862
private String getIdForLocale(String locale) {

        return CmsContentDefinition.uuidToEntityId(CmsContentDefinition.entityIdToUuid(m_entityId), locale);
    }
1278648
def entry_id_from_cobra_encoding(cobra_id):
    """"""
    for escape, symbol in iteritems(_COBRA_DECODE_ESCAPES):
        cobra_id = cobra_id.replace(escape, symbol)
    return cobra_id
80481
public Selector resolve(Identifier id, PositionAssigner positionAssigner) {
    positionAssigner.assign(id);
    // set the selector domain into the identifier
    id.setSelectorDomain(selectorDomain.toInt());
    return id;
  }
367533
function (translationId) {
              var deferred = $q.defer();
              var regardless = function (value) {
                results[translationId] = value;
                deferred.resolve([translationId, value]);
              };
              // we don't care whether the promise was resolved or rejected; just store the values
              $translate(translationId, interpolateParams, interpolationId, defaultTranslationText).then(regardless, regardless);
              return deferred.promise;
            }
224048
private int resolveCharEnt(StringBuffer originalCharacters)
        throws XMLStreamException
    {
        int value = 0;
        char c = getNextChar(SUFFIX_IN_ENTITY_REF);
        
        if (originalCharacters != null) {
            originalCharacters.append(c);
        }
        
        if (c == 'x') { // hex
            while (true) {
                c = (mInputPtr < mInputEnd) ? mInputBuffer[mInputPtr++]
                    : getNextCharFromCurrent(SUFFIX_IN_ENTITY_REF);
                if (c == ';') {
                    break;
                }
                
                if (originalCharacters != null) {
                    originalCharacters.append(c);
                }
                value = value << 4;
                if (c <= '9' && c >= '0') {
                    value += (c - '0');
                } else if (c >= 'a' && c <= 'f') {
                    value += 10 + (c - 'a');
                } else if (c >= 'A' && c <= 'F') {
                    value += 10 + (c - 'A');
                } else {
                    throwUnexpectedChar(c, "; expected a hex digit (0-9a-fA-F).");
                }
                // Overflow?
                if (value > MAX_UNICODE_CHAR) {
                    reportUnicodeOverflow();
                }
            }
        } else { // numeric (decimal)
            while (c != ';') {
                if (c <= '9' && c >= '0') {
                    value = (value * 10) + (c - '0');
                    // Overflow?
                    if (value > MAX_UNICODE_CHAR) {
                        reportUnicodeOverflow();
                    }
                } else {
                    throwUnexpectedChar(c, "; expected a decimal number.");
                }
                c = (mInputPtr < mInputEnd) ? mInputBuffer[mInputPtr++]
                    : getNextCharFromCurrent(SUFFIX_IN_ENTITY_REF);
                
                if (originalCharacters != null && c != ';') {
                    originalCharacters.append(c);
                }
            }
        }
        validateChar(value);
        return value;
    }
1038332
function (text, languageCode, id) {
        var payload = textHelper.encodePayload(text, languageCode);
        if (!id) { id = []; }

        return ndef.record(ndef.TNF_WELL_KNOWN, ndef.RTD_TEXT, id, payload);
    }
936655
function resolveLanguage ( value ) {
	if ( typeof value === 'string' ) {
		const lang = _.find(langs, ( o ) => { return o.locale.indexOf(value) !== -1; });
		if ( typeof lang !== 'undefined' ) {
			return lang.id;
		}
	}
	return value;
}
1234452
private static function resolveScheme(){
        $scheme = filter_input(INPUT_SERVER, "REQUEST_SCHEME");
        $https  = filter_input(INPUT_SERVER, "HTTPS");

        if(is_string($scheme)){
            return strtolower($scheme);
        }

        if(null !== $https){
            if(is_bool($https)){
                return $https ? "https" : "http";
            }

            return "off" === $https ? "http" : "https";
        }

        return "http";
    }