// Identifier transforms the container steps in the Yaml and assigns a unique
// container identifier.
333333
func Identifier(c *yaml.Config) error {

	// creates a random prefix for the build
	rand := base64.RawURLEncoding.EncodeToString(
		securecookie.GenerateRandomKey(8),
	)

	for i, step := range c.Services {
		step.ID = fmt.Sprintf("drone_%s_%d", rand, i)
	}

	for i, step := range c.Pipeline {
		step.ID = fmt.Sprintf("drone_%s_%d", rand, i+len(c.Services))
	}

	return nil
}
1145828
func (s *IngestDeletePipelineService) Id(id string) *IngestDeletePipelineService {
	s.id = id
	return s
}
269988
func SingularizeIdentifier(s string) string {
	if i := reverseIndexRune(s, '_'); i != -1 {
		s = s[:i] + "_" + inflector.Singularize(s[i+1:])
	} else {
		s = inflector.Singularize(s)
	}

	return snaker.SnakeToCamelIdentifier(s)
}
6730
func (i IdentifierSet) AddIdentifiers(idents Identifiers) {
	for _, ident := range idents {
		i.Add(ident)
	}
}
1182318
func (t *TermsLookup) Id(id string) *TermsLookup {
	t.id = id
	return t
}
1074724
func (dht *DHT) id(target string) string {
	if dht.IsStandardMode() || target == "" {
		return dht.node.id.RawString()
	}
	return target[:15] + dht.node.id.RawString()[15:]
}
1349625
func (o *GetNodesIdentifierWorkflowsParams) WithIdentifier(identifier string) *GetNodesIdentifierWorkflowsParams {
	o.Identifier = identifier
	return o
}
578978
func (s *XPackWatcherPutWatchService) Id(id string) *XPackWatcherPutWatchService {
	s.id = id
	return s
}
156392
func GetIdentifier() Identifier {
	mu.Lock()
	defer mu.Unlock()

	if identifier == nil {
		identifier = &UUID{}
	}
	return identifier
}
996376
func (t *FpdfTpl) ID() string {
	return fmt.Sprintf("%x", sha1.Sum(t.Bytes()))
}
359700
func ident(isCaseSensitive bool, s string) string {
	if isCaseSensitive {
		return s
	}
	return strings.ToLower(s)
}
750734
func (o *GetTemplatesLibraryIdentifierParams) WithIdentifier(identifier string) *GetTemplatesLibraryIdentifierParams {
	o.Identifier = identifier
	return o
}
612793
func checkShadowAssignment(f *File, a *ast.AssignStmt) {
	if a.Tok != token.DEFINE {
		return
	}
	if f.idiomaticShortRedecl(a) {
		return
	}
	for _, expr := range a.Lhs {
		ident, ok := expr.(*ast.Ident)
		if !ok {
			f.Badf(expr.Pos(), "invalid AST: short variable declaration of non-identifier")
			return
		}
		checkShadowing(f, ident)
	}
}
620927
func (self *LightingX10) Id() string {
	return fmt.Sprintf("%s%02x", lightingX10HouseCodes[self.HouseCode], self.UnitCode)
}
462034
func (set IdentifierSet) Add(i Identifier) bool {
	_, found := set[i]
	set[i] = struct{}{}
	return !found //False if it existed already
}
379607
func (s *S3Grantee) SetIdentifier(v string) *S3Grantee {
	s.Identifier = &v
	return s
}
927630
func (p *parser) parseIdentifier() (result string, err error) {
	startingDash := false
	if len(p.s) > p.i && p.s[p.i] == '-' {
		startingDash = true
		p.i++
	}

	if len(p.s) <= p.i {
		return "", errors.New("expected identifier, found EOF instead")
	}

	if c := p.s[p.i]; !(nameStart(c) || c == '\\') {
		return "", fmt.Errorf("expected identifier, found %c instead", c)
	}

	result, err = p.parseName()
	if startingDash && err == nil {
		result = "-" + result
	}
	return
}