// DeleteLabelMapping removes a Label mapping.
192007
func (s *LabelService) DeleteLabelMapping(ctx context.Context, m *platform.LabelMapping) error {
	return s.DeleteLabelMappingFn(ctx, m)
}
944752
func (s *Service) createLabelMapping(ctx context.Context, tx Tx, m *influxdb.LabelMapping) error {
	if _, err := s.findLabelByID(ctx, tx, m.LabelID); err != nil {
		return err
	}

	if err := s.putLabelMapping(ctx, tx, m); err != nil {
		return err
	}

	return nil
}
963241
func (m *Manager) Delete(username string, label string) (err error) {
	_, err = m.getCollection().RemoveAll(bson.M{"username": username, "label": label})
	return
}
1318510
func (c *Client) DeleteLabel(ctx context.Context, id influxdb.ID) error {
	err := c.db.Update(func(tx *bolt.Tx) error {
		return c.deleteLabel(ctx, tx, id)
	})
	if err != nil {
		return &influxdb.Error{
			Op:  getOp(influxdb.OpDeleteLabel),
			Err: err,
		}
	}
	return nil
}
947622
func processLabels(spec map[string]string) map[string]string {
	if len(spec) == 0 {
		// return nil map to make the field go away
		return nil
	}
	return spec
}
473245
func (s *LabelService) DeleteLabel(ctx context.Context, id influxdb.ID) error {
	l, err := s.s.FindLabelByID(ctx, id)
	if err != nil {
		return err
	}

	if err := authorizeWriteLabel(ctx, l.OrgID, id); err != nil {
		return err
	}

	return s.s.DeleteLabel(ctx, id)
}
557354
func (v *DeviceMapperVolume) RemoveSnapshot(label string) error {
	glog.V(2).Infof("RemoveSnapshot() (%s) START", v.name)
	defer glog.V(2).Infof("RemoveSnapshot() (%s) END", v.name)
	if !v.snapshotExists(label) {
		return volume.ErrSnapshotDoesNotExist
	}
	rawLabel := v.rawSnapshotLabel(label)
	v.Lock()
	defer v.Unlock()
	deviceHash, err := v.Metadata.LookupSnapshotDevice(rawLabel)
	if err != nil {
		glog.Errorf("Error removing snapshot: %v", err)
		return volume.ErrRemovingSnapshot
	}

	// Delete the device itself first, so we retain our internal snapshot entry
	// (metadata.json) in the event of a failure on this step
	glog.V(2).Infof("Deactivating snapshot device %s", deviceHash)
	v.driver.DeviceSet.Lock()
	if err := v.driver.DeactivateDevice(deviceHash); err != nil {
		glog.V(2).Infof("Error deactivating device (%s): %s", deviceHash, err)
	}
	v.driver.DeviceSet.Unlock()
	if err := v.driver.deleteDevice(deviceHash, false); err != nil {
		glog.Errorf("Error removing snapshot: %v", err)
		return volume.ErrRemovingSnapshot
	}

	// Remove the snapshot info from the volume metadata
	if err := v.Metadata.RemoveSnapshot(rawLabel); err != nil {
		glog.Errorf("Error removing snapshot: %v", err)
		return volume.ErrRemovingSnapshot
	}
	// Remove the snapshot-specific metadata directory
	if err := os.RemoveAll(filepath.Join(v.driver.MetadataDir(), rawLabel)); err != nil {
		return err
	}
	return nil
}
65168
func (c *Card) RemoveIDLabel(labelID string, label *Label) error {
	path := fmt.Sprintf("cards/%s/idLabels/%s", c.ID, labelID)
	return c.client.Delete(path, Defaults(), label)

}
311728
func ClearLabels() {
	state.Lock()
	state.mcsList = make(map[string]bool)
	state.Unlock()
}
554668
func labelsToString(labels map[string][]string) string {
	ls := []string{}
	for k, v := range labels {
		ls = append(ls, fmt.Sprintf("%s:%v", k, v))
	}
	sort.Strings(ls)
	return strings.Join(ls, " ")
}
878838
func (c *Client) PolicyDelete(labels []string) (*models.Policy, error) {
	params := policy.NewDeletePolicyParams().WithLabels(labels).WithTimeout(api.ClientTimeout)
	resp, err := c.Policy.DeletePolicy(params)
	if err != nil {
		return nil, Hint(err)
	}
	return resp.Payload, Hint(err)
}
1341204
func AddLabel(labels map[string]string, labelKey, labelValue string) map[string]string {
	if labelKey == "" {
		// Don't need to add a label.
		return labels
	}
	if labels == nil {
		labels = make(map[string]string)
	}
	labels[labelKey] = labelValue
	return labels
}
1155328
func makeLabels(m *dto.Metric) map[string]string {
	result := map[string]string{}
	for _, lp := range m.Label {
		result[lp.GetName()] = lp.GetValue()
	}
	return result
}
519574
func (s *LabelService) DeleteLabel(ctx context.Context, id platform.ID) error {
	return s.DeleteLabelFn(ctx, id)
}
692521
func (g *Gui) DeleteKeybindings(viewname string) {
	var s []*keybinding
	for _, kb := range g.keybindings {
		if kb.viewName != viewname {
			s = append(s, kb)
		}
	}
	g.keybindings = s
}
758580
func (m Map) Delete(prefix string) {
	for k, _ := range m {
		match := k == prefix
		if !match {
			if !strings.HasPrefix(k, prefix) {
				continue
			}

			if k[len(prefix):len(prefix)+1] != "." {
				continue
			}
		}

		delete(m, k)
	}
}
1108999
func DeleteIssueLabel(issue *Issue, label *Label) (err error) {
	sess := x.NewSession()
	defer sess.Close()
	if err = sess.Begin(); err != nil {
		return err
	}

	if err = deleteIssueLabel(sess, issue, label); err != nil {
		return err
	}

	return sess.Commit()
}