Add a tag to a job.
545625
def add_tag_to_job(user, job_id):
    """"""

    job = v1_utils.verify_existence_and_get(job_id, _TABLE)
    if not user.is_in_team(job['team_id']):
        raise dci_exc.Unauthorized()

    values = {
        'job_id': job_id
    }

    job_tagged = tags.add_tag_to_resource(values, models.JOIN_JOBS_TAGS)

    return flask.Response(json.dumps(job_tagged), 201,
                          content_type='application/json')
816457
def create_tag(tag_name, kind='z'):
        '''
        
        '''
        cur_recs = TabTag.select().where(
            (TabTag.name == tag_name) &
            (TabTag.kind == kind)
        )
        if cur_recs.count():
            uid = cur_recs.get().uid

            # TabTag.delete().where(
            #     (TabTag.name == tag_name) &
            #     (TabTag.kind == kind)
            # ).execute()
        else:
            uid = tools.get_uu4d_v2()  # Label with the ID of v2.
            while TabTag.select().where(TabTag.uid == uid).count() > 0:
                uid = tools.get_uu4d_v2()

            TabTag.create(
                uid=uid,
                slug=uid,
                name=tag_name,
                order=1,
                count=0,
                kind='z',
                tmpl=9,
                pid='zzzz',
            )
        return uid
498757
def tag_and_push(context):
    """"""
    tag_option = '--annotate'
    if probe.has_signing_key(context):
        tag_option = '--sign'

    shell.dry_run(
        TAG_TEMPLATE % (tag_option, context.new_version, context.new_version),
        context.dry_run,
    )

    shell.dry_run('git push --tags', context.dry_run)
1302116
def _addTags(tags, objects):
    
    for t in tags:
        for o in objects:
            o.tags.add(t)

    return True
335864
def add_tags(self, *tags):
        '''
        
        '''
        normed_tags = self.api.manager._normalize_tags(tags)
        self.api.manager.add_tags(self.archive_name, normed_tags)
701185
def tag(name, tag_name):
    

    with LOCK:
        # just to check if <name> exists
        metric(name)

        TAGS.setdefault(tag_name, set()).add(name)
536866
private static void appendTag(String tag, StringBuilder buffer) {
        if (buffer.length() != 0) {
            buffer.append(UNDERSCORE);
        }

        buffer.append(tag);
    }
294255
def set_tag(self, tag):
        """"""
        return Eq(
            self._lhs, self._rhs, tag=tag,
            _prev_lhs=self._prev_lhs, _prev_rhs=self._prev_rhs,
            _prev_tags=self._prev_tags)
279994
def new_tag(self, label, cfrom=-1, cto=-1, tagtype='', **kwargs):
        '''  '''
        tag_obj = Tag(label, cfrom, cto, tagtype=tagtype, **kwargs)
        return self.add_tag(tag_obj)
878825
def get_tags_from_job(user, job_id):
    """"""

    job = v1_utils.verify_existence_and_get(job_id, _TABLE)
    if not user.is_in_team(job['team_id']) and not user.is_read_only_user():
        raise dci_exc.Unauthorized()

    JTT = models.JOIN_JOBS_TAGS
    query = (sql.select([models.TAGS])
             .select_from(JTT.join(models.TAGS))
             .where(JTT.c.job_id == job_id))
    rows = flask.g.db_conn.execute(query)

    return flask.jsonify({'tags': rows, '_meta': {'count': rows.rowcount}})
393945
def add_attribute(self, tag, name, value):
        
        self.add_tag(tag)
        d = self._tags[tag]
        d[name] = value
1267058
def add_tags(self, tags):
        
        if not isinstance(tags, list):
            tags = [tags]
        self._bugsy.request('bug/comment/%s/tags' % self._comment['id'],
                            method='PUT', json={"add": tags})
46227
def add_tag(tag_name, timeout)
      cmd = { :name => :add_tag, :tag => tag_name }
      response = blocking_request(cmd, timeout)
      result = OperationResult.from_results(load(response, "Unexpected response #{response.inspect}"))
      if result.success?
        ::Chef::Log.info("Successfully added tag #{tag_name}")
      else
        raise TagError.new("Add tag failed: #{result.content}")
      end
      true
    end
1061846
def _modify_tag(self, name, description, servers, new_name):
        
        body = {'tag': Tag(new_name, description, servers).to_dict()}
        res = self.request('PUT', '/tag/' + name, body)
        return res['tag']
614035
def add_tags(self, **kwargs):
        
        j, _ = self.datacenter.request('POST', self.path + '/tags', 
            data=kwargs)
        return j
926941
def tag():
    """"""
    if check_unstaged():
        raise EnvironmentError('There are staged changes, abort.')
    with open(str(INIT_PATH)) as f:
        metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", f.read()))
    version = metadata['version']
    check_output(['git', 'tag', version, '-m', 'Release v{}'.format(version)])
62334
def add_tags(self, *tags):
        
        self.tags.extend([
            Tag(name=tag) for tag in tags
        ])