Return True if the lang param is present and URL isn't exempt.
773728
def _is_lang_change(self, request):
        """"""
        if 'lang' not in request.GET:
            return False

        return not any(request.path.endswith(url) for url in self.exempt_urls)
548545
protected function checkIfNoLanguageFallback()
    {
        $tsfe = self::getTsfe();
        // Check if we have fallen back to a default language
        if (GeneralUtility::getLanguageId() !== $tsfe->sys_language_uid) {
            return false; //don't index untranslated page
        }
        return true;
    }
293146
private function isBaeEnv() {
		if (isset ( $_SERVER ['HTTP_HOST'] )) {
			$host = $_SERVER ['HTTP_HOST'];
			$pos = strpos ( $host, '.' );
			if ($pos !== false) {
				$substr = substr ( $host, $pos + 1 );
				if ($substr == 'duapp.com') {
					return true;
				}
			}
		}
		if (isset ( $_SERVER ["HTTP_BAE_LOGID"] )) {
			return true;
		}

		return false;
	}
1264703
public function detectCurrentLanguage()
    {
        // parsing url to get only path & removing prefix if there is one
        $escapedPathPrefix = Text::escapeForRegex($this->config->getPathPrefix());
        $uriPath = parse_url($this->config->getRaw(), PHP_URL_PATH);
        $uriPath = preg_replace('/^' . $escapedPathPrefix . '/s', '', $uriPath);
        $uriSegments = explode('/', $uriPath);

        if (isset($uriSegments[1]) && in_array($uriSegments[1], $this->translate->getLanguages())) {
            return $uriSegments[1];
        }
        return $this->translate->getDefault();
    }
540151
def is_valid_article_slug(article, language, slug):
    
    from ..models import Title

    qs = Title.objects.filter(slug=slug, language=language)

    if article.pk:
        qs = qs.exclude(Q(language=language) & Q(article=article))
        qs = qs.exclude(article__publisher_public=article)

    if qs.count():
        return False

    return True
644372
public function isMultilang()
	{
		// Flag to avoid doing multiple database queries.
		static $tested = false;

		// Status of language filter plugin.
		static $enabled = false;

		// If being called from the front-end, we can avoid the database query.
		if (\App::isSite())
		{
			return \App::get('language.filter');
		}

		// If already tested, don't test again.
		if (!$tested)
		{
			// Determine status of language filter plug-in.
			$db = \App::get('db');
			$query = $db->getQuery()
				->select('enabled')
				->from('#__extensions')
				->whereEquals('type', 'plugin')
				->whereEquals('folder', 'system')
				->whereEquals('element', 'languagefilter');
			$db->setQuery($query->toString());

			$enabled = $db->loadResult();
			$tested  = true;
		}

		return $enabled;
	}
628904
def _validate_no_rels(param, rels):
    

    if param.field in rels:
        raise InvalidQueryParams(**{
            'detail': 'The sort query param value of "%s" is not '
                      'supported. Sorting on relationships is not '
                      'currently supported' % param.raw_field,
            'links': LINK,
            'parameter': PARAM,
        })
202227
protected static boolean hasScheme(StringBuffer uri) {
        int len = uri.length();
        for (int i = 0; i < len; i++) {
            char c = uri.charAt(i);
            if (c == ':') {
                return i > 0;
            } else if (!isSchemeChar(c)) {
                return false;
            }
        }
        return false;
    }
985586
def has(self, lang, instance):
        
        instance_key = TransCache._create_key(lang, instance)
        return instance_key in self.cache
603145
def has_content_in(page, language):
    
    if page is None:
        return False
    return Content.objects.filter(page=page, language=language).count() > 0
188937
function isReserved (chr) {
        return chr === ':' || chr === '/' || chr === '?' || chr === '#' || chr === '[' || chr === ']' || chr === '@' || chr === '!' || chr === '$' || chr === '&' || chr === '(' ||
            chr === ')' || chr === '*' || chr === '+' || chr === ',' || chr === ';' || chr === '=' || chr === "'";
    }
169404
function getLanguageFromQueryString() {
    if (location.search.length >= 1) {
      var language = parseURL(location.search).language
      if (language) {
        return language;
      } else if (jQuery.inArray(location.search.substr(1), languages) != -1) {
        return location.search.substr(1);
      }
    }

    return false;
  }
685676
def is_url(value):
    ""
    if not isinstance(value, str):
        return False
    if not value.startswith('http://') and not value.startswith('https://'):
        return False
    # Any whitespace at all is invalid
    if whitespace_re.search(value):
        return False
    return True
567995
def url_is(white_list):
    
    def func(url):
        prefixes = white_list.get('PREFIXES', ())
        for prefix in prefixes:
            if url.startswith(prefix):
                return True
        constants = white_list.get('CONSTANTS', ())
        for exact_url in constants:
            if url == exact_url:
                return True
        return False
    return func
142165
static boolean isPrefixEqual(String aUrlStr, String bUrlStr)
  throws MalformedURLException
  {
    URL aUrl = new URL(aUrlStr);
    URL bUrl = new URL(bUrlStr);
    int aPort = aUrl.getPort();
    int bPort = bUrl.getPort();
    if (aPort == -1 && "https".equals(aUrl.getProtocol()))
    {
      // default port number for HTTPS
      aPort = 443;
    }
    if (bPort == -1 && "https".equals(bUrl.getProtocol()))
    {
      // default port number for HTTPS
      bPort = 443;
    }
    // no default port number for HTTP is supported.
    return aUrl.getHost().equalsIgnoreCase(bUrl.getHost()) &&
           aUrl.getProtocol().equalsIgnoreCase(bUrl.getProtocol()) &&
           aPort == bPort;
  }
1102295
protected function checkParameters()
    {
        if (isset($this->parameters[self::PARAMETER_DEFAULT_LANGUAGE])) {
            self::$DEFAULT_LANGUAGE = $this->parameters[self::PARAMETER_DEFAULT_LANGUAGE];
            unset($this->parameters[self::PARAMETER_DEFAULT_LANGUAGE]);
        }
        if (isset($this->parameters[self::PARAMETER_ACCEPTED_LANGUAGES])) {
            $this->acceptedLanguages = explode(',', $this->parameters[self::PARAMETER_ACCEPTED_LANGUAGES]);
            unset($this->parameters[self::PARAMETER_ACCEPTED_LANGUAGES]);
        }
        if (isset($this->parameters[self::PARAMETER_LANGUAGE_PARAMETER_NAME])) {
            $this->languageParameterName = $this->parameters[self::PARAMETER_LANGUAGE_PARAMETER_NAME];
            unset($this->parameters[self::PARAMETER_LANGUAGE_PARAMETER_NAME]);
        }
        if (isset($this->parameters[self::PARAMETER_FORCE_REDIRECT])) {
            $this->forceRedirect = (bool)$this->parameters[self::PARAMETER_FORCE_REDIRECT];
            unset($this->parameters[self::PARAMETER_FORCE_REDIRECT]);
        }
    }
1307304
boolean checkIntegrity () {
        if (headerType == null) return false;
        if (headerType == HeaderType.MODE_PARAMETER_HEADER_6 && longLba) return false;
        return true;
    }