// Prefix a given string with tool name
975099
func (r *Realize) Prefix(input string) string {
	if len(input) > 0 {
		return fmt.Sprint(Yellow.Bold("["), strings.ToUpper(RPrefix), Yellow.Bold("]"), " : ", input)
	}
	return input
}
1285033
func (s *ListObjectsOutput) SetPrefix(v string) *ListObjectsOutput {
	s.Prefix = &v
	return s
}
1087222
func (l *LockerOptions) Prefix() string {
	prefix := l.prefix
	if !strings.HasPrefix(prefix, "/") {
		prefix = "/" + prefix
	}

	if prefix == "" {
		return DefaultPrefix
	} else {
		return prefix
	}
}
7928
func (me *Logger) SetPrefix(prefix string) {
	me.prefix = prefix
	me.logger.SetPrefix(prefix)
}
558784
func ParsePrefix(line string) *Prefix {
	// Start by creating an Prefix with nothing but the host
	id := &Prefix{
		Name: line,
	}

	uh := strings.SplitN(id.Name, "@", 2)
	if len(uh) == 2 {
		id.Name, id.Host = uh[0], uh[1]
	}

	nu := strings.SplitN(id.Name, "!", 2)
	if len(nu) == 2 {
		id.Name, id.User = nu[0], nu[1]
	}

	return id
}
2321
func (r *Router) WithPrefix(prefix string) *Router {
	return &Router{rtr: r.rtr, prefix: r.prefix + prefix, instrh: r.instrh}
}
565273
func (j *Jobs) PrefixList(prefix string) ([]*JobListStub, *QueryMeta, error) {
	return j.List(&QueryOptions{Prefix: prefix})
}
168988
func SetPrefix(prefix string) {
	defaultWriter.mutex.Lock()
	log.SetPrefix(prefix)

	// Special case if the default writer is backed by a text handler so we can
	// make it output the right prefix.
	if h, ok := defaultWriter.handler.(*text.Handler); ok {
		h.Prefix = prefix
	}

	defaultWriter.prefix = prefix
	defaultWriter.mutex.Unlock()
}
1175495
func (b *BatchBuilder) AddWithPrefix(prefix string, builder Builder) *BatchBuilder {
	stmt, names := builder.ToCql()
	return b.AddStmtWithPrefix(prefix, stmt, names)
}
590741
func cutoutVerbosePrefix(prefix string) string {
	if len(prefix) == 0 || prefix[0] != '/' {
		return prefix
	}
	count := 0
	for i := 0; i < len(prefix); i++ {
		if prefix[i] == '/' {
			count++
		}
		if count >= 3+setting.AppSubURLDepth {
			return prefix[:i]
		}
	}
	return prefix
}
1221990
func (c Cid) Prefix() Prefix {
	dec, _ := mh.Decode(c.Hash()) // assuming we got a valid multiaddr, this will not error
	return Prefix{
		MhType:   dec.Code,
		MhLength: dec.Length,
		Version:  c.Version(),
		Codec:    c.Type(),
	}
}
1658
func GenerateWithPrefix(prefix string, characters uint8) string {
	return Prefixed{Prefix: prefix, Len: characters}.Generate()
}
318388
func (t Trilean) Prefix(s string) string {
	if t == Yes {
		return s
	} else if t == No {
		return "no" + s
	}
	return ""
}
606972
func prefixName(prefix, name string) string {
	if prefix != "" {
		name = prefix + "." + name
	}
	return name
}
1001024
func (t RefType) Prefix() (string, bool) {
	switch t {
	case RefTypeLocalBranch:
		return "refs/heads", true
	case RefTypeRemoteBranch:
		return "refs/remotes", true
	case RefTypeLocalTag:
		return "refs/tags", true
	default:
		return "", false
	}
}
213127
func (p *PathManager) RemovePathPrefix(prefix string) {
	p.l.Lock()
	defer p.l.Unlock()

	// We trim any trailing *, but we don't touch whether it is a trailing
	// slash or not since we want to be able to ignore prefixes that fully
	// specify a file
	p.paths, _ = p.paths.DeletePrefix([]byte(strings.TrimSuffix(prefix, "*")))
}
1258987
func PrunePrefixes(prefixes []string) []string {
	prunedPrefixes := []string{}
	for i := 0; i < len(prefixes); i++ {
		foundPrefix := false
		for j := 0; j < len(prefixes); j++ {
			if i == j {
				continue
			}
			if strings.HasPrefix(prefixes[i], prefixes[j]) {
				foundPrefix = true
			}
		}
		if !foundPrefix {
			prunedPrefixes = append(prunedPrefixes, prefixes[i])
		}
	}
	return prunedPrefixes
}