Submit a tag batch
160923
def submit_tag_batch(self, batch):
        """"""
        url = '%s/api/v5/batch/tags' % self.base_url
        self._submit_batch(url, batch)
140938
private void updateTagData(Map<Poi, Map<String, String>> pois, String key, String value) {
        for (Map.Entry<Poi, Map<String, String>> entry : pois.entrySet()) {
            Poi poi = entry.getKey();
            String tmpValue = value;

            Map<String, String> tagmap = entry.getValue();
            if (!tagmap.keySet().contains("name")) {
                continue;
            }

            if (tagmap.keySet().contains(key)) {
                // Process is_in tags
                if (!key.equals("is_in")) {
                    continue;
                }
                String prev = tagmap.get(key);
                // Continue if tag already set correctly
                if (prev.contains(",") || prev.contains(";")) {
                    continue;
                }
                // If string is a correct value, append it to existent value;
                if (tmpValue.contains(",") || tmpValue.contains(";")) {
                    tmpValue = (prev + "," + tmpValue);
                }
            }

            //Write surrounding area as parent in "is_in" tag.
            tagmap.put(key, tmpValue);
            try {
                this.pStmtUpdateData.setLong(2, poi.id);
                this.pStmtUpdateData.setString(1, writer.tagsToString(tagmap));

                this.pStmtUpdateData.addBatch();

                batchCountRelation++;
                if (batchCountRelation % PoiWriter.BATCH_LIMIT == 0) {
                    pStmtUpdateData.executeBatch();
                    pStmtUpdateData.clearBatch();
                    writer.conn.commit();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
167944
def submit(self):
        """"""
        self._newflg = False
        ret = list()
        for buf in self._buffer.values():
            buf = copy.deepcopy(buf)
            if self._fdpext:
                buf['fpout'] = f"{self._fproot}/{buf['label']}.{self._fdpext}"
            else:
                del buf['fpout']
            buf['index'] = tuple(buf['index'])
            ret.append(Info(buf))
        ret += self._stream
        return tuple(ret)
298336
def set_tags(
            self,
            tags=""):
        
        self.refresh
        tagList = []
        regex = re.compile(r'@[^@]*', re.S)
        matchList = regex.findall(tags)
        for m in matchList:
            tagList.append(m.strip().replace("@", ""))

        self.refresh
        oldContent = self.to_string(indentLevel=1)
        self.tags = tagList
        newContent = self.to_string(indentLevel=1)

        # ADD DIRECTLY TO CONTENT IF THE PROJECT IS BEING ADDED SPECIFICALLY TO
        # THIS OBJECT
        self.parent._update_document_tree(
            oldContent=oldContent,
            newContent=newContent
        )
        self.refresh
        return None
697640
def raw_tag(name, value):
    """"""
    return name.encode('utf-8') + \
        len(value).to_bytes(4, byteorder='big') + \
        value
971696
public function batchCreate(array $tags) {
        $requests = [];

        $required = ['title'];

        foreach ($tags as $data) {
            foreach ($required as $attribute) {
                if (!array_key_exists($attribute, $data)) {
                    throw new BadMethodCallException(sprintf(
                        'Missing attribute "%s"',
                        $attribute
                    ));
                }
            }

            $requests[] = [
                'method' => 'checkmk.statictag.create',
                'params' => [
                    'data' => $data
                ]
            ];
        }

        $result = $this->api->batchRequest($requests);

        $tagIDs = [];

        foreach ($result as $tag) {
            // Do not check 'id' because in a batch request it is always NULL:
            if (!array_key_exists('success', $tag) ||
                $tag['success'] !== true) {
                if (array_key_exists('message', $tag)) {
                    throw new RuntimeException(sprintf('Bad result: %s', $tag['message']));
                } else {
                    throw new RuntimeException('Bad result');
                }
            }

            $tagIDs[] = $tag['id'];
        }

        return $tagIDs;
    }
716412
def tag(self, *tag, **kwtags):
        """"""
        if not tag:
            pass
        elif len(tag) == 1 and isinstance(tag[0], dict):
            self._meta.update(tag[0])
        else:
            raise TypeError('Tags must be provided as key-word arguments or '
                            'a dictionary')
        self._meta.update(kwtags)
        return self
978730
def tag(path, name):
  '''  '''

  output, err = cli_syncthing_adapter.tag(path, name)
  click.echo("%s" % output, err=err)
1015936
public function updateBatchTags(
        $batchId, array $tagsToAdd, array $tagsToRemove
    ) {
        $json = Serialize::tagsUpdate($tagsToAdd, $tagsToRemove);
        $result = $this->_post($this->_batchUrl($batchId, '/tags'), $json);
        return Deserialize::tags($result);
    }
313342
def submitbutton(self, request, tag):
        
        return tags.input(type='submit',
                          name='__submit__',
                          value=self._getDescription())
113461
def tag_myself(project='cwc', **other_tags):
    """"""
    base_url = "http://169.254.169.254"
    try:
        resp = requests.get(base_url + "/latest/meta-data/instance-id")
    except requests.exceptions.ConnectionError:
        logger.warning("Could not connect to service. Note this should only "
                       "be run from within a batch job.")
        return
    instance_id = resp.text
    tag_instance(instance_id, project=project, **other_tags)
    return
1133721
def tag_users(self, tag_id, open_id_list):
        
        return self.post(
            url="https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging",
            data={
                "openid_list": open_id_list,
                "tagid": tag_id
            }
        )
924684
def workflow_validate_batch(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/validateBatch' % object_id, input_params, always_retry=always_retry, **kwargs)
462711
def input(self, request, tag):
        
        subform = self.parameter.form.asSubForm(self.parameter.name)
        subform.setFragmentParent(self)
        return tag[subform]
149975
def add_tags(ctx, archive_name, tags):
    '''
    
    '''

    _generate_api(ctx)

    var = ctx.obj.api.get_archive(archive_name)

    var.add_tags(*tags)
370473
def do_batch(resource_root, elements):
  
  return call(resource_root.post, BATCH_PATH, ApiBatchResponseList,
      data=elements, api_version=6)
857650
def tagged(self, tag):
    """"""
    return Scm(self.connection, self.developer_connection, self.url, tag=tag)