Add a tag to existing device tags. This method will not add a duplicate, if already in the list.

        :param new_tags: the tag(s) to be added. new_tags can be a comma-separated string or list
420752
def add_tag(self, new_tags):
        

        tags = self.get_tags()
        orig_tag_cnt = len(tags)
        # print("self.get_tags() {}".format(tags))

        if isinstance(new_tags, six.string_types):
            new_tags = new_tags.split(',')
            # print("spliting tags :: {}".format(new_tags))

        for tag in new_tags:
            if not tag in tags:
                tags.append(tag.strip())

        if len(tags) > orig_tag_cnt:
            xml_tags = escape(",".join(tags))
            post_data = TAGS_TEMPLATE.format(connectware_id=self.get_connectware_id(),
                                             tags=xml_tags)
            self._conn.put('/ws/DeviceCore', post_data)

            # Invalidate cache
            self._device_json = None
943832
public void setAddTags(java.util.Collection<Tag> addTags) {
        if (addTags == null) {
            this.addTags = null;
            return;
        }

        this.addTags = new java.util.ArrayList<Tag>(addTags);
    }
1047459
public void addTag(Tag tag) {
    set(PackageMetadata.TAGS, concat(getTags(), singletonList(tag)));
  }
409076
def set_tag(note_store, my_tags, tag_id):
        
        new_tag = Types.Tag()
        for my_tag in my_tags.split(','):
            new_tag.name = my_tag
            note_tag_id = EvernoteMgr.create_tag(note_store, new_tag)
            if note_tag_id is not False:
                tag_id.append(note_tag_id)
            else:
                return False
        return tag_id
1325690
def new_tag(self, name: str, category: str=None) -> models.Tag:
        """"""
        new_tag = self.Tag(name=name, category=category)
        return new_tag
388575
def update_tags(self, image_id, new_tags):
        
        # Do not add :param list in the docstring above until this is solved:
        # https://github.com/sphinx-doc/sphinx/issues/2549
        old_image = self.get(image_id)

        old_tags = frozenset(old_image.tags)
        new_tags = frozenset(new_tags)

        to_add = list(new_tags - old_tags)
        to_remove = list(old_tags - new_tags)

        add_response, remove_response = None, None

        if to_add:
            add_response = self._post('/images/%s/tag' % image_id,
                                      {'tags': to_add}, 'image')

        if to_remove:
            remove_response = self._post('/images/%s/untag' % image_id,
                                         {'tags': to_remove}, 'image')

        return remove_response or add_response or self.get(image_id)
827946
def project_add_tags(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/addTags' % object_id, input_params, always_retry=always_retry, **kwargs)
850248
def update_tags(self, idlist, tags_add=None, tags_remove=None):
        
        tags = {}
        if tags_add:
            tags["add"] = self._listify(tags_add)
        if tags_remove:
            tags["remove"] = self._listify(tags_remove)

        d = {
            "ids": self._listify(idlist),
            "tags": tags,
        }

        return self._proxy.Bug.update_tags(d)
1295176
def create_or_update_tags(self, tags):
        
        params = {}
        for i, tag in enumerate(tags):
            tag.build_params(params, i+1)
        return self.get_status('CreateOrUpdateTags', params, verb='POST')
269926
def add_tags(self, tags, **kwargs):
        
        if self._dxid is not None:
            return dxpy.api.app_add_tags(self._dxid, input_params={"tags": tags}, **kwargs)
        else:
            return dxpy.api.app_add_tags('app-' + self._name, alias=self._alias,
                                         input_params={"tags": tags}, **kwargs)
872408
@SuppressWarnings("unchecked")
    public T addTag(String tag) {
        if (this.tags_ == null) {
            tags_ = new ArrayList<>();
        }
        this.tags_.add(tag);
        return (T) this;
    }
849091
def add_tags_shares(self, tags: dict = dict()):
        
        # check if shares_id have already been retrieved or not
        if not hasattr(self, "shares_id"):
            shares = self.shares()
            self.shares_id = {
                "share:{}".format(i.get("_id")): i.get("name") for i in shares
            }
        else:
            pass
        # update query tags
        tags.update(self.shares_id)
867506
def add_tags(self, md5, tags):
        """"""
        if not tags: return
        tag_set = set(self.get_tags(md5)) if self.get_tags(md5) else set()
        if isinstance(tags, str):
            tags = [tags]
        for tag in tags:
            tag_set.add(tag)
        self.data_store.store_work_results({'tags': list(tag_set)}, 'tags', md5)
539371
def tag_add_devices(tag,channel_ids)
			set_resource_and_method(__method__)
			@params = {tag:tag,channel_ids:channel_ids.to_json}
			send_request
		end
614035
def add_tags(self, **kwargs):
        
        j, _ = self.datacenter.request('POST', self.path + '/tags', 
            data=kwargs)
        return j
276555
def tag(self, tags):
        
        # Get tag list and add/remove given tags
        tags = tags.lower()
        previous = self.tagged
        tagset = previous.copy()
        for tag in tags.replace(',', ' ').split():
            if tag.startswith('-'):
                tagset.discard(tag[1:])
            elif tag.startswith('+'):
                tagset.add(tag[1:])
            else:
                tagset.add(tag)

        # Write back new tagset, if changed
        tagset.discard('')
        if tagset != previous:
            tagset = ' '.join(sorted(tagset))
            self._make_it_so("setting tags %r on" % (tagset,), ["custom.set"], "tags", tagset)
            self._fields["custom_tags"] = tagset
516036
def setTags( self, tags ):
        
        self.setUpdatesEnabled(False)
        self.blockSignals(True)
        
        self.clear()
        for tag in tags:
            self.addItem(XMultiTagItem(tag, self))
        
        self.blockSignals(False)
        self.setUpdatesEnabled(True)