Removes existing association and associates `tags` with post with id `post_id`

@param {Number} post_id
@param {Array} tags
@param {Function} cb
977414
function postSetTags(post_id, tags, cb) {
  var ids = _.pluck(tags, 'id')
    , q1 = 'DELETE FROM posts_tags WHERE post_id = $1'
    , q2 = 'INSERT INTO posts_tags (post_id, tag_id) VALUES ' +
    ids.map(function(id) {
      return '(' + post_id + ',' + id + ')';
    }).join(', ');

  db.getClient(function(err, client, done) {
    client.query(q1, [post_id], function(err, r) {
      if(err) { return cb(err); }
      client.query(q2, function(err, r) {
        if(err) {
          cb(err);
          done(err);
        } else {
          cb(null, r.rowCount);
          done();
        }
      });
    });
  });
}
493799
def tags_delete(tag)
      params = { tag: tag }

      options = create_params(params)
      self.class.get('/tags/delete', options)
      nil
    end
765949
function del(body, cb) {
  db.getClient(function(err, client, done) {
    client.query(DELETE, [body.post_id, body.tag_id], function(err, r) {
      if(err) {
        cb(err);
        done(err);
      } else {
        cb(null, r.rowCount);
        done();
      }
    });
  });
}
821924
function deleteTags(cb) {
  git.fetch({ tags: true, remote: remote }, function (err) {
    if (err) {
      return cb(err);
    }
    git.getTags(function(err, tags) {
      if (err) {
        return cb(err);
      }
      
      git.removeTags({
        tags: tags,
        remote: remote
      }, cb);
      
    });
  });
}
134416
public static function delete_tags($tagids) {
        global $DB;

        if (!is_array($tagids)) {
            $tagids = array($tagids);
        }
        if (empty($tagids)) {
            return;
        }

        // Use the tagids to create a select statement to be used later.
        list($tagsql, $tagparams) = $DB->get_in_or_equal($tagids);

        // Store the tags and tag instances we are going to delete.
        $tags = $DB->get_records_select('tag', 'id ' . $tagsql, $tagparams);
        $taginstances = $DB->get_records_select('tag_instance', 'tagid ' . $tagsql, $tagparams);

        // Delete all the tag instances.
        $select = 'WHERE tagid ' . $tagsql;
        $sql = "DELETE FROM {tag_instance} $select";
        $DB->execute($sql, $tagparams);

        // Delete all the tag correlations.
        $sql = "DELETE FROM {tag_correlation} $select";
        $DB->execute($sql, $tagparams);

        // Delete all the tags.
        $select = 'WHERE id ' . $tagsql;
        $sql = "DELETE FROM {tag} $select";
        $DB->execute($sql, $tagparams);

        // Fire an event that these items were untagged.
        if ($taginstances) {
            // Save the system context in case the 'contextid' column in the 'tag_instance' table is null.
            $syscontextid = context_system::instance()->id;
            // Loop through the tag instances and fire a 'tag_removed'' event.
            foreach ($taginstances as $taginstance) {
                // We can not fire an event with 'null' as the contextid.
                if (is_null($taginstance->contextid)) {
                    $taginstance->contextid = $syscontextid;
                }

                // Trigger tag removed event.
                \core\event\tag_removed::create_from_tag_instance($taginstance,
                    $tags[$taginstance->tagid]->name, $tags[$taginstance->tagid]->rawname,
                    true)->trigger();
            }
        }

        // Fire an event that these tags were deleted.
        if ($tags) {
            $context = context_system::instance();
            foreach ($tags as $tag) {
                // Delete all files associated with this tag.
                $fs = get_file_storage();
                $files = $fs->get_area_files($context->id, 'tag', 'description', $tag->id);
                foreach ($files as $file) {
                    $file->delete();
                }

                // Trigger an event for deleting this tag.
                $event = \core\event\tag_deleted::create(array(
                    'objectid' => $tag->id,
                    'relateduserid' => $tag->userid,
                    'context' => $context,
                    'other' => array(
                        'name' => $tag->name,
                        'rawname' => $tag->rawname
                    )
                ));
                $event->add_record_snapshot('tag', $tag);
                $event->trigger();
            }
        }

        return true;
    }
659303
def remove_tag(self, p_key, p_value=""):
        
        self._remove_tag_helper(p_key, p_value)

        # when value == "", match any value having key p_key
        value = p_value if p_value != "" else r'\S+'
        self.src = re.sub(r'\s?\b' + p_key + ':' + value + r'\b', '', self.src)
176554
function remove(tags, i) {
      tags.splice(i, 1);
      this.unmount();
      arrayishRemove(this.parent, this, this.__.tagName, true);
    }
367088
function(tag) {
    var posts = [];
    for (var key in this.posts) {
      if (this.posts[key].tags && this.posts[key].tags.indexOf(tag) !== -1) {
        posts.push(this.posts[key]);
      }
    }
    return posts;
  }
931899
def remove_tag(self, resource_type, resource_id, tag, **_params):
        """"""
        return self.delete(self.tag_path % (resource_type, resource_id, tag))
476154
function favorites_tags_update( $id,  $tags )
	{
		$params = array();
		$params['id'] = $id;
		if (is_array($tags) && !empty($tags)) {
			foreach ($tags as $k => $v) {
				$this->id_format($tags[$k]);
			}
			$params['tags'] = join(',', $tags);
		} else {
			$params['tags'] = $tags;
		}
		return $this->oauth->post( 'favorites/tags/update', $params );
	}
1038875
function moveChildTag(tag, tagName, newPos) {
  var parent = tag.parent,
    tags
  // no parent no move
  if (!parent) return

  tags = parent.tags[tagName]

  if (isArray(tags))
    tags.splice(newPos, 0, tags.splice(tags.indexOf(tag), 1)[0])
  else addChildTag(tag, tagName, parent)
}
1331136
def _remove_tag_helper(self, p_key, p_value):
        
        tags = self.fields['tags']

        try:
            tags[p_key] = [t for t in tags[p_key] if p_value != "" and t != p_value]
            if len(tags[p_key]) == 0:
                del tags[p_key]
        except KeyError:
            pass
407908
def untag_users(self, tag_id, open_id_list):
        
        return self.post(
            url="https://api.weixin.qq.com/cgi-bin/tags/members/batchuntagging",
            data={
                "openid_list": open_id_list,
                "tagid": tag_id
            }
        )
975714
def workflow_remove_tags(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/removeTags' % object_id, input_params, always_retry=always_retry, **kwargs)
1040709
def tag_remove(self, *tags):
        
        return View({**self.spec, 'tag': list(set(self.tags) - set(tags))})
738148
def update_tags
      @post = LatoBlog::Post.find_by(id: params[:id])
      return unless check_post_presence

      params_tags = params[:tags].map(&:to_i)
      tag_posts = LatoBlog::TagPost.where(lato_blog_post_id: @post.id)

      params_tags.each do |tag_id|
        tag = LatoBlog::Tag.find_by(id: tag_id)
        next if !tag || tag.meta_language != @post.meta_language

        tag_post = tag_posts.find_by(lato_blog_tag_id: tag.id)
        LatoBlog::TagPost.create(lato_blog_post_id: @post.id, lato_blog_tag_id: tag.id) unless tag_post
      end

      tag_ids = tag_posts.pluck(:lato_blog_tag_id)
      tag_ids.each do |tag_id|
        next if params_tags.include?(tag_id)
        tag_post = tag_posts.find_by(lato_blog_tag_id: tag_id)
        tag_post.destroy if tag_post
      end
    end
1049081
def tag(**tags):
    
    transaction = execution_context.get_transaction()
    if not transaction:
        error_logger.warning("Ignored tags %s. No transaction currently active.", ", ".join(tags.keys()))
    else:
        transaction.tag(**tags)