// Registers a new tag. You usually want to call this
// function in the tag's init() function:
// http://golang.org/doc/effective_go.html#init
//
// See http://www.florian-schlachter.de/post/pongo2/ for more about
// writing filters and tags.
552393
func RegisterTag(name string, parserFn TagParser) error {
	_, existing := tags[name]
	if existing {
		return errors.Errorf("tag with name '%s' is already registered", name)
	}
	tags[name] = &tag{
		name:   name,
		parser: parserFn,
	}
	return nil
}
411588
func Tag(key string, value interface{}) Option {
	return func(c *Options) {
		c.tags = append(c.tags, opentracing.Tag{Key: key, Value: value})
	}
}
751662
func (c *Manager) CreateTag(ctx context.Context, tag *Tag) (string, error) {
	// create avoids the annoyance of CreateTag requiring a "description" key to be included in the request,
	// even though the field value can be empty.
	type create struct {
		Name        string `json:"name"`
		Description string `json:"description"`
		CategoryID  string `json:"category_id"`
	}
	spec := struct {
		Tag create `json:"create_spec"`
	}{
		Tag: create{
			Name:        tag.Name,
			Description: tag.Description,
			CategoryID:  tag.CategoryID,
		},
	}
	if isName(tag.CategoryID) {
		cat, err := c.GetCategory(ctx, tag.CategoryID)
		if err != nil {
			return "", err
		}
		spec.Tag.CategoryID = cat.ID
	}
	url := internal.URL(c, internal.TagPath)
	var res string
	return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res)
}
427258
func (f *Field) AddTag(tag string) FieldInterface {
	f.tag[tag] = struct{}{}
	return f
}
507370
func (t *Tag) Append(b ...Body) {
	t.Body = append(t.Body, b...)
}
318439
func (entry *Entry) GetTag() (Tag, error) {
	var t C.acl_tag_t
	rv, _ := C.acl_get_tag_type(entry.e, &t)
	if rv < 0 {
		return TagUndefined, fmt.Errorf("unable to get tag")
	}
	return Tag(t), nil
}
175102
func NewTag(code int, value DataType) *Tag {
	tag := new(Tag)
	tag.Code = code
	tag.Value = value
	return tag
}
910260
func (L *State) Register(name string, f LuaGoFunction) {
	L.PushGoFunction(f)
	L.SetGlobal(name)
}
1014846
func (c *Conversation) InitializeInstanceTag(tag uint32) uint32 {
	if tag == 0 {
		c.generateInstanceTag()
	} else {
		c.ourInstanceTag = tag
	}
	return c.ourInstanceTag
}
318372
func (c *TagCache) AddTag(ctx context.Context, pin common.Pin, tag string) error {
	if err := common.ValidatePin(pin, common.AnyHash); err != nil {
		return err
	}
	if err := common.ValidateInstanceTag(tag); err != nil {
		return err
	}

	c.lock.Lock()
	defer c.lock.Unlock()

	if c.addedTags == nil {
		c.addedTags = make(map[tagKey]*messages.TagCache_Entry, 1)
	}

	// 'Save' will merge this into 'c.cache' before dumping to disk.
	c.addedTags[makeTagKey(pin.PackageName, tag)] = &messages.TagCache_Entry{
		Service:    c.service,
		Package:    pin.PackageName,
		Tag:        tag,
		InstanceId: pin.InstanceID,
	}

	return nil
}
381674
func (mr *MockRuntimeReaderMockRecorder) Tag(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tag", reflect.TypeOf((*MockRuntimeReader)(nil).Tag), arg0)
}
1325604
func Tag(tag string, m ...MarkupOrChild) *HTML {
	h := &HTML{
		tag: tag,
	}
	for _, m := range m {
		apply(m, h)
	}
	return h
}
1265943
func (c *TasksCountCall) Tags(tags ...string) *TasksCountCall {
	c.urlParams_.SetMulti("tags", append([]string{}, tags...))
	return c
}
809916
func (t *Tagger) Add(tag ...string) {
	t.tags = append(t.tags, tag...)
}
1273894
func NewMapperTagFunc(tagName string, mapFunc, tagMapFunc func(string) string) *Mapper {
	return &Mapper{
		cache:      make(map[reflect.Type]*StructMap),
		tagName:    tagName,
		mapFunc:    mapFunc,
		tagMapFunc: tagMapFunc,
	}
}
518191
func (p *Program) Tags(fn func(t Tag, value string)) {
	if fn == nil {
		return
	}
	fn(idTag, p.UID())
	if p.name != "" {
		fn(programNameTag, p.name)
	}
	if p.command != "" {
		fn(commandLineTag, p.command)
	}
	if p.previous != "" {
		fn(previousProgTag, p.previous)
	}
	if p.version != "" {
		fn(versionTag, p.version)
	}
	for _, tp := range p.otherTags {
		fn(tp.tag, tp.value)
	}
}
442097
func (mr *MockScopeMockRecorder) Tagged(tags interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tagged", reflect.TypeOf((*MockScope)(nil).Tagged), tags)
}