// InsertTagged inserts a row at a given index with specific tags.
426043
func (d *Dataset) InsertTagged(index int, row []interface{}, tags ...string) error {
	if err := d.Insert(index, row); err != nil {
		return err
	}
	d.Insert(index, row)
	d.tags[index] = tags[:]

	return nil
}
868273
func (e *Encoder) SetTagCommented(v string) *Encoder {
	e.commented = v
	return e
}
1140582
func NewInsert(tags core.TagSlice) (*Insert, error) {
	insert := new(Insert)

	// set defaults
	insert.ScaleFactorX = 1.0
	insert.ScaleFactorY = 1.0
	insert.ScaleFactorZ = 1.0
	insert.RotationAngle = 0.0
	insert.ColumnCount = 1
	insert.RowCount = 1
	insert.ColumnSpacing = 0.0
	insert.RowSpacing = 0.0
	insert.Entities = make(EntitySlice, 0)
	insert.ExtrusionDirection = core.Point{X: 0.0, Y: 0.0, Z: 1.0}

	insert.InitBaseEntityParser()
	insert.Update(map[int]core.TypeParser{
		2:  core.NewStringTypeParserToVar(&insert.BlockName),
		10: core.NewFloatTypeParserToVar(&insert.InsertionPoint.X),
		20: core.NewFloatTypeParserToVar(&insert.InsertionPoint.Y),
		30: core.NewFloatTypeParserToVar(&insert.InsertionPoint.Z),
		41: core.NewFloatTypeParserToVar(&insert.ScaleFactorX),
		42: core.NewFloatTypeParserToVar(&insert.ScaleFactorY),
		43: core.NewFloatTypeParserToVar(&insert.ScaleFactorZ),
		44: core.NewFloatTypeParserToVar(&insert.ColumnSpacing),
		45: core.NewFloatTypeParserToVar(&insert.RowSpacing),
		50: core.NewFloatTypeParserToVar(&insert.RotationAngle),
		66: core.NewIntTypeParser(func(value int) {
			insert.AttributesFollow = value == 1
		}),
		70:  core.NewIntTypeParserToVar(&insert.ColumnCount),
		71:  core.NewIntTypeParserToVar(&insert.RowCount),
		210: core.NewFloatTypeParserToVar(&insert.ExtrusionDirection.X),
		220: core.NewFloatTypeParserToVar(&insert.ExtrusionDirection.Y),
		230: core.NewFloatTypeParserToVar(&insert.ExtrusionDirection.Z),
	})

	err := insert.Parse(tags)
	return insert, err
}
206526
func (m *Meta) InsertValues(i interface{}) []interface{} {
	values := make([]interface{}, len(m.insertIndexes))
	m.CopyInsertValues(i, values)
	return values
}
53542
func (d *Dataset) Tags(index int) ([]string, error) {
	if index < 0 || index >= d.rows {
		return nil, ErrInvalidRowIndex
	}

	return d.tags[index], nil
}
584249
func (s *nodeStack) insert(i int, n *Node) {
	(*s) = append(*s, nil)
	copy((*s)[i+1:], (*s)[i:])
	(*s)[i] = n
}
32582
func (r *ReqInfo) AppendTags(key string, val string) *ReqInfo {
	if r == nil {
		return nil
	}
	r.Lock()
	defer r.Unlock()
	r.tags = append(r.tags, KeyVal{key, val})
	return r
}
1341752
func (p *point) AddTag(key, value string) {
	tags := p.Tags()
	tags = append(tags, Tag{Key: []byte(key), Value: []byte(value)})
	sort.Sort(tags)
	p.cachedTags = tags
	p.key = MakeKey(p.Name(), tags)
}
257456
func (m *UnpartitionedMemoryIdx) indexTags(def *schema.MetricDefinition) {
	tags, ok := m.tags[def.OrgId]
	if !ok {
		tags = make(TagIndex)
		m.tags[def.OrgId] = tags
	}

	for _, tag := range def.Tags {
		tagSplits := strings.SplitN(tag, "=", 2)
		if len(tagSplits) < 2 {
			// should never happen because every tag in the index
			// must have a valid format
			invalidTag.Inc()
			log.Errorf("memory-idx: Tag %q of id %q has an invalid format", tag, def.Id)
			continue
		}

		tagName := tagSplits[0]
		tagValue := tagSplits[1]
		tags.addTagId(tagName, tagValue, def.Id)
	}
	tags.addTagId("name", def.Name, def.Id)

	m.defByTagSet.add(def)
}
1057361
func (d *Dataset) Append(row []interface{}) error {
	if len(row) != d.cols {
		return ErrInvalidDimensions
	}
	d.data = append(d.data, row)
	d.tags = append(d.tags, make([]string, 0))
	d.rows++
	return nil
}
432537
func (col *Col) Insert(doc map[string]interface{}) (id int, err error) {
	docJS, err := json.Marshal(doc)
	if err != nil {
		return
	}
	id = rand.Int()
	partNum := id % col.db.numParts
	col.db.schemaLock.RLock()
	part := col.parts[partNum]

	// Put document data into collection
	part.DataLock.Lock()
	_, err = part.Insert(id, []byte(docJS))
	part.DataLock.Unlock()
	if err != nil {
		col.db.schemaLock.RUnlock()
		return
	}

	part.LockUpdate(id)
	// Index the document
	col.indexDoc(id, doc)
	part.UnlockUpdate(id)

	col.db.schemaLock.RUnlock()
	return
}
809916
func (t *Tagger) Add(tag ...string) {
	t.tags = append(t.tags, tag...)
}
996537
func (t *Table) Insert() (stmt string, names []string) {
	return t.insert.stmt, t.insert.names
}
427258
func (f *Field) AddTag(tag string) FieldInterface {
	f.tag[tag] = struct{}{}
	return f
}
85622
func (s Strategy) tagsChanged(old, stream *imageapi.ImageStream) field.ErrorList {
	internalRegistry, hasInternalRegistry := s.registryHostnameRetriever.InternalRegistryHostname()

	var errs field.ErrorList

	oldTags := map[string]imageapi.TagReference{}
	if old != nil && old.Spec.Tags != nil {
		oldTags = old.Spec.Tags
	}

	for tag, tagRef := range stream.Spec.Tags {
		if oldRef, ok := oldTags[tag]; ok && !tagRefChanged(oldRef, tagRef, stream.Namespace) {
			continue
		}

		if tagRef.From == nil {
			continue
		}

		klog.V(5).Infof("Detected changed tag %s in %s/%s", tag, stream.Namespace, stream.Name)

		generation := stream.Generation
		tagRef.Generation = &generation

		fromPath := field.NewPath("spec", "tags").Key(tag).Child("from")
		if tagRef.From.Kind == "DockerImage" && len(tagRef.From.Name) > 0 {
			if tagRef.Reference {
				event, err := tagReferenceToTagEvent(stream, tagRef, "")
				if err != nil {
					errs = append(errs, field.Invalid(fromPath, tagRef.From, err.Error()))
					continue
				}
				stream.Spec.Tags[tag] = tagRef
				imageapi.AddTagEventToImageStream(stream, tag, *event)
			}
			continue
		}

		tagRefStreamName, tagOrID, err := parseFromReference(stream, tagRef.From)
		if err != nil {
			errs = append(errs, field.Invalid(fromPath.Child("name"), tagRef.From.Name, "must be of the form <tag>, <repo>:<tag>, <id>, or <repo>@<id>"))
			continue
		}

		streamRef := stream
		streamRefNamespace := tagRef.From.Namespace
		if len(streamRefNamespace) == 0 {
			streamRefNamespace = stream.Namespace
		}
		if streamRefNamespace != stream.Namespace || tagRefStreamName != stream.Name {
			obj, err := s.imageStreamGetter.Get(apirequest.WithNamespace(apirequest.NewContext(), streamRefNamespace), tagRefStreamName, &metav1.GetOptions{})
			if err != nil {
				if kerrors.IsNotFound(err) {
					errs = append(errs, field.NotFound(fromPath.Child("name"), tagRef.From.Name))
				} else {
					errs = append(errs, field.Invalid(fromPath.Child("name"), tagRef.From.Name, fmt.Sprintf("unable to retrieve image stream: %v", err)))
				}
				continue
			}

			streamRef = obj.(*imageapi.ImageStream)
		}

		event, err := tagReferenceToTagEvent(streamRef, tagRef, tagOrID)
		if err != nil {
			errs = append(errs, field.Invalid(fromPath.Child("name"), tagRef.From.Name, fmt.Sprintf("error generating tag event: %v", err)))
			continue
		}
		if event == nil {
			// referenced tag or ID doesn't exist, which is ok
			continue
		}

		// if this is not a reference tag, and the tag points to the internal registry for the other namespace, alter it to
		// point to this stream so that pulls happen from this stream in the future.
		if !tagRef.Reference {
			if ref, err := imageapi.ParseDockerImageReference(event.DockerImageReference); err == nil {
				if hasInternalRegistry && ref.Registry == internalRegistry && ref.Namespace == streamRef.Namespace && ref.Name == streamRef.Name {
					ref.Namespace = stream.Namespace
					ref.Name = stream.Name
					event.DockerImageReference = ref.Exact()
				}
			}
		}

		stream.Spec.Tags[tag] = tagRef
		imageapi.AddTagEventToImageStream(stream, tag, *event)
	}

	imageapi.UpdateChangedTrackingTags(stream, old)

	// use a consistent timestamp on creation
	if old == nil && !stream.CreationTimestamp.IsZero() {
		for tag, list := range stream.Status.Tags {
			for _, event := range list.Items {
				event.Created = stream.CreationTimestamp
			}
			stream.Status.Tags[tag] = list
		}
	}

	return errs
}
824439
func (g *Group) Insert(e *GroupExpr) bool {
	if g.Exists(e) {
		return false
	}

	operand := GetOperand(e.ExprNode)
	var newEquiv *list.Element
	mark, hasMark := g.FirstExpr[operand]
	if hasMark {
		newEquiv = g.Equivalents.InsertAfter(e, mark)
	} else {
		newEquiv = g.Equivalents.PushBack(e)
		g.FirstExpr[operand] = newEquiv
	}
	g.Fingerprints[e.FingerPrint()] = newEquiv
	return true
}
587183
func (s *Schedule) SetTagsToAdd(v []*Tag) *Schedule {
	s.TagsToAdd = v
	return s
}