// DeleteLabel delete a label of given repository.
185585
func DeleteLabel(repoID, labelID int64) error {
	_, err := GetLabelOfRepoByID(repoID, labelID)
	if err != nil {
		if IsErrLabelNotExist(err) {
			return nil
		}
		return err
	}

	sess := x.NewSession()
	defer sess.Close()
	if err = sess.Begin(); err != nil {
		return err
	}

	if _, err = sess.ID(labelID).Delete(new(Label)); err != nil {
		return err
	} else if _, err = sess.Where("label_id = ?", labelID).Delete(new(IssueLabel)); err != nil {
		return err
	}

	return sess.Commit()
}
109456
func (_m *Light) SetLabel(label string) error {
	ret := _m.Called(label)

	var r0 error
	if rf, ok := ret.Get(0).(func(string) error); ok {
		r0 = rf(label)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
1015753
func (s *Service) CreateLabel(ctx context.Context, l *influxdb.Label) error {
	l.ID = s.IDGenerator.ID()
	s.labelKV.Store(l.ID, *l)
	return nil
}
280659
func (m *Manager) DeleteClient(clientID, label string) (err error) {
	_, err = m.getClientsCollection().RemoveAll(bson.M{"clientid": clientID, "label": label})
	return
}
1022489
func (s *RemovePermissionInput) SetLabel(v string) *RemovePermissionInput {
	s.Label = &v
	return s
}
812146
func (s *CreateLunaClientInput) SetLabel(v string) *CreateLunaClientInput {
	s.Label = &v
	return s
}
562669
func makeLabel(labelName string, labelVal string) map[string]string {
	return map[string]string{labelName: labelVal}
}
1193744
func (l *IssueLabelsService) Remove(uri *Hyperlink, uriParams M) (success bool, result *Result) {
	url, err := ExpandWithDefault(uri, &IssueLabelsURL, uriParams)
	if err != nil {
		return false, &Result{Err: err}
	}

	result = l.client.delete(url, nil, nil)

	success = (result.Response.StatusCode == 204)
	return
}
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)
}
385911
func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%d/labels/%v", owner, repo, number, label)
	req, err := s.client.NewRequest("DELETE", u, nil)
	if err != nil {
		return nil, err
	}

	// TODO: remove custom Accept header when this API fully launches.
	req.Header.Set("Accept", mediaTypeLabelDescriptionSearchPreview)

	return s.client.Do(ctx, req, nil)
}
653337
func (repo *Repository) DeleteTag(name string) error {
	cmd := NewCommand("tag", "-d")

	cmd.AddArguments(name)
	_, err := cmd.RunInDir(repo.Path)

	return err
}
405380
func (s *ContentModerationDetection) SetModerationLabel(v *ModerationLabel) *ContentModerationDetection {
	s.ModerationLabel = v
	return s
}
506406
func (s *AddPermissionInput) SetLabel(v string) *AddPermissionInput {
	s.Label = &v
	return s
}
833252
func (p *PodContainer) AddLabel(key, value string) *PodContainer {
	p.Labels[key] = value
	return p
}
795876
func (v *RsyncVolume) RemoveSnapshot(label string) error {
	v.Lock()
	defer v.Unlock()
	label = v.rawSnapshotLabel(label)
	dest := v.snapshotPath(label)
	if exists, _ := volume.IsDir(dest); !exists {
		return volume.ErrSnapshotDoesNotExist
	}
	if err := os.RemoveAll(filepath.Join(v.driver.MetadataDir(), label)); err != nil {
		return err
	} else if err := os.RemoveAll(dest); err != nil {
		glog.Errorf("Could not remove snapshot %s: %s", label, err)
		return volume.ErrRemovingSnapshot
	}
	return nil
}
712605
func (c *Client) GetLabel(labelID string, args Arguments) (label *Label, err error) {
	path := fmt.Sprintf("labels/%s", labelID)
	err = c.Get(path, args, &label)
	return
}
932868
func (issue *Issue) HasLabel(labelID int64) bool {
	return issue.hasLabel(x, labelID)
}