Get the string that should be used as base for the slug.
163309
protected function getSlugSourceString()
    {
        // if callback given
        if (is_callable($this->slugOptions->generateSlugFrom)) {
            $slug = call_user_func($this->slugOptions->generateSlugFrom, $this);

            return substr($slug, 0, $this->slugOptions->maximumLength);
        }

        // concatenate on the fields and implode on seperator
        $slug = collect($this->slugOptions->generateSlugFrom)->map(function ($fieldName = '') {
            return $this->$fieldName;
        })->implode($this->slugOptions->slugSeparator);

        return substr($slug, 0, $this->slugOptions->maximumLength);
    }
264339
public function getBasePart(): string
    {
        $string = str_replace($this->getLastPart(), "", $this->getFqcn());
        if (isset($string[-1]) && $string[-1] == "\\") {
            $string = substr($string, 0, -1);
        }
        
        return $string;
    }
1039232
def show_slug_with_level(context, page, lang=None, fallback=True):
    """"""
    if not lang:
        lang = context.get('lang', pages_settings.PAGE_DEFAULT_LANGUAGE)

    page = get_page_from_string_or_id(page, lang)
    if not page:
        return ''

    return {'content': page.slug_with_level(lang)}
1075543
private String getBaseString() {
		if (!hasTs()) {
			throw new IllegalStateException(
					"This HawkWwwAuthenticateContext has no timestamp");
		}
		return new StringBuilder(HAWK_TS_PREFIX).append(SLF).append(getTs())
				.append(SLF).toString();
	}
603800
def get_string(self, key):
        """"""

        # Massive hack, lol
        if key.startswith("lambda."):
            key = "lambda.items.{0}".format(key[7:])
        if key.startswith("apigateway."):
            key = "apigateway.items.{0}".format(key[11:])

        # Make sure key is in all_options
        if key not in self.all_options:
            kwargs = {}
            if len(self.chain) > 1:
                kwargs['source'] = Meta(self.all_options, self.chain[-2]).source
            raise BadOptionFormat("Can't find key in options", key=key, chain=self.chain, **kwargs)

        return super(MergedOptionStringFormatter, self).get_string(key)
103998
def base_url(root):
    """"""
    for attr, value in root.attrib.iteritems():
        if attr.endswith('base') and 'http' in value:
            return value
    return None
924215
def decode(slug):
    
    if sys.version_info.major != 2 and isinstance(slug, bytes):
        slug = slug.decode('ascii')
    slug = slug + '=='  # base64 padding
    return uuid.UUID(bytes=base64.urlsafe_b64decode(slug))
787573
def slug(self):
        
        return '{:s}@{:s}[{:d}, {:d}]'.format(self.type, self.seqid,
                                              self.start + 1, self.end)
1201002
private function getBaseUrl() {
        $uri = $this->getRequest()->getUri();
        return sprintf('%s://%s', $uri->getScheme(), $uri->getHost());
    }
1061505
def generate_slug(self, model_instance):
        """"""
        queryset = model_instance.__class__._default_manager.all()

        # Only count slugs that match current length to prevent issues
        # when pre-existing slugs are a different length.
        lookup = {'%s__regex' % self.attname: r'^.{%s}$' % self.length}
        if queryset.filter(**lookup).count() >= len(self.chars)**self.length:
            raise FieldError("No available slugs remaining.")

        slug = get_random_string(self.length, self.chars)

        # Exclude the current model instance from the queryset used in
        # finding next valid slug.
        if model_instance.pk:
            queryset = queryset.exclude(pk=model_instance.pk)

        # Form a kwarg dict used to impliment any unique_together
        # contraints.
        kwargs = {}
        for params in model_instance._meta.unique_together:
            if self.attname in params:
                for param in params:
                    kwargs[param] = getattr(model_instance, param, None)
        kwargs[self.attname] = slug

        while queryset.filter(**kwargs):
            slug = get_random_string(self.length, self.chars)
            kwargs[self.attname] = slug

        return slug
356291
def title_slug
      value = (@options['slug'] || @options['title']).downcase
      value.gsub!(/[^\x00-\x7F]/u, '')
      value.gsub!(/(&amp;|&)+/, 'and')
      value.gsub!(/[']+/, '')
      value.gsub!(/\W+/, ' ')
      value.strip!
      value.gsub!(' ', '-')
      value
    end
1210209
protected function getSlugFromName($name)
    {
        if( array_key_exists($name, self::$sluggedNames) ) {
            return self::$sluggedNames[$name];
        }

        return self::$sluggedNames[$name] = trim(Str::slug($name, '-'));
    }
1340787
def slug(self, language=None, fallback=True):
        

        slug = self.get_content(language, 'slug', language_fallback=fallback)

        return slug
1194600
def get_complete_slug(self, language=None, hideroot=True):
        """"""
        if not language:
            language = settings.PAGE_DEFAULT_LANGUAGE

        if self._complete_slug and language in self._complete_slug:
            return self._complete_slug[language]

        self._complete_slug = cache.get(self.PAGE_URL_KEY % (self.id))
        if self._complete_slug is None:
            self._complete_slug = {}
        elif language in self._complete_slug:
            return self._complete_slug[language]

        if hideroot and settings.PAGE_HIDE_ROOT_SLUG and self.is_first_root():
            url = u''
        else:
            url = u'%s' % self.slug(language)
        for ancestor in self.get_ancestors(ascending=True):
            url = ancestor.slug(language) + u'/' + url

        self._complete_slug[language] = url
        cache.set(self.PAGE_URL_KEY % (self.id), self._complete_slug)
        return url
16451
public function base_uri(){
    	$uri = $this->uri();
		if (($strpos = strpos($uri, '?')) !== false) 
			$uri = substr($uri, 0, $strpos);
		return $uri;
    }
915621
def slug(s, remove_whitespace=True, lowercase=True):
    """"""
    res = ''.join(c for c in unicodedata.normalize('NFD', s)
                  if unicodedata.category(c) != 'Mn')
    if lowercase:
        res = res.lower()
    for c in string.punctuation:
        res = res.replace(c, '')
    res = re.sub('\s+', '' if remove_whitespace else ' ', res)
    res = res.encode('ascii', 'ignore').decode('ascii')
    assert re.match('[ A-Za-z0-9]*$', res)
    return res
379306
public function getUrlAttribute()
    {
        $url = '';

        foreach (array_reverse($this->getAncestors()->all()) as $parent) {
            $url = '/'.$parent->slug.$url;
        }

        return "/buy$url/".$this->slug;
    }