Insert or Update a Tag into TagContext given provided TagKey with
provided string value.

@param TagKey $key key of the Tag.
@param TagValue $value value of the Tag.
16161
final public function upsert(TagKey $key, TagValue $value)
    {
        $this->m[$key->getName()] = new Tag($key, $value);
    }
1041020
public static function setOpenGraphTag($key, $value)
    {
        $key   = (string)$key;
        $value = (string)$value;

        self::$store['flag']['meta:og:external'] = true;
        self::$store['meta:og'][$key]            = $value;
    }
593174
def set(self, key, value):
        
        if key == "tags":
            self._set_tag(tags=value)
        else:
            if isinstance(value, dict) and key in self._requirements and isinstance(
                    self._requirements[key], dict):
                self._requirements[key] = merge(self._requirements[key], value)
            else:
                self._requirements[key] = value
624612
protected function addTag($tagPos, $tagLen, $hex)
	{
		$tag = $this->parser->addSelfClosingTag($this->config['tagName'], $tagPos, $tagLen, 10);

		// Short sequence, only the relevant codepoints are kept
		$seq = str_replace(['-200d', '-fe0f'], '', $hex);
		$tag->setAttribute('seq', $seq);

		// Twemoji sequence, leading zeroes and trailing VS16 are removed
		$tseq = preg_replace('(-fe0f$)', '', ltrim($hex, '0'));
		$tag->setAttribute('tseq', $tseq);
	}
511721
public function setValue($key, $value)
    {
        $this->langstrings[$key] = $value;
        $this->debug('SetValue ' . $key . ' => ' . $value);
    }
1029189
protected function storeContent($key, $content, $tag) {
		$key = $this->getRealKey ( $key );
		$item = $this->cacheInstance->getItem ( $key );
		$item->set ( $content );
		$item->addTag ( $tag );
		$this->cacheInstance->save ( $item );
	}
494433
def add_tag(self, tag, value):
        
        index = bisect_left(self.tags, (tag, value))
        contains = False
        if index < len(self.tags):
            contains = self.tags[index] == (tag, value)
        if not contains:
            self.tags.insert(index, (tag, value))
678350
public synchronized DownloadTask addTag(int key, Object value) {
        if (keyTagMap == null) {
            synchronized (this) {
                if (keyTagMap == null) keyTagMap = new SparseArray<>();
            }
        }

        keyTagMap.put(key, value);
        return this;
    }
62701
protected function setTags($key, array $tags = [])
    {
        if (empty($tags)) {
            return;
        }

        foreach ($this->prepareTags($tags) as $tag) {
            if (($keys = $this->storage->get($tag)) !== false) {
                $keys = $this->unserialize($keys);
                if (in_array($key, $keys, true)) {
                    continue;
                }
                $keys[] = $key;
                $this->setInternal($tag, $this->serialize($keys), 0);
                continue;
            }
            $this->setInternal($tag, $this->serialize((array)$key), 0);
        }
    }
397509
public function addCacheTag($key, $value)
    {
        if ($this->runtimeContentCache->getEnableContentCache() === false) {
            return;
        }
        $this->runtimeContentCache->addTag($key, $value);
    }
683618
public function set(string $id, $value, array $tags = []): void
    {
        $this->values[$id] = $value;
        foreach ($tags as $tag) {
            $this->tags[$tag][] = $id;
        }
    }
1312024
public SimpleHTMLTag setProperty(String key, String value) {
        key = UniformUtils.checkPropertyNameAndLowerCase(key);

        if (properties == null) {
            properties = new HashMap<>();
        }

        properties.put(key, value);

        return this;
    }
702146
public function set($key, $value) {
		$this->validateValue($value);
		$this->variables[$key] = $value;
	}
1290848
public function addValue(string $key, string $value) : void
    {
        $this->map[$key] = $value;
    }
650173
protected function pushContext(Tag $tag)
	{
		$tagName   = $tag->getName();
		$tagFlags  = $tag->getFlags();
		$tagConfig = $this->tagsConfig[$tagName];

		++$this->cntTotal[$tagName];

		// If this is a self-closing tag, the context remains the same
		if ($tag->isSelfClosingTag())
		{
			return;
		}

		// Recompute the allowed tags
		$allowed = [];
		if ($tagFlags & self::RULE_IS_TRANSPARENT)
		{
			foreach ($this->context['allowed'] as $k => $v)
			{
				$allowed[] = $tagConfig['allowed'][$k] & $v;
			}
		}
		else
		{
			foreach ($this->context['allowed'] as $k => $v)
			{
				$allowed[] = $tagConfig['allowed'][$k] & (($v & 0xFF00) | ($v >> 8));
			}
		}

		// Use this tag's flags as a base for this context and add inherited rules
		$flags = $tagFlags | ($this->context['flags'] & self::RULES_INHERITANCE);

		// RULE_DISABLE_AUTO_BR turns off RULE_ENABLE_AUTO_BR
		if ($flags & self::RULE_DISABLE_AUTO_BR)
		{
			$flags &= ~self::RULE_ENABLE_AUTO_BR;
		}

		++$this->cntOpen[$tagName];
		$this->openTags[] = $tag;
		$this->context = [
			'allowed'       => $allowed,
			'flags'         => $flags,
			'inParagraph'   => false,
			'parentContext' => $this->context
		];
	}
706651
def with_tag(key, value)
      new_tags = @tags.dup
      new_tags[key] = value
      MeterId.new(@name, new_tags)
    end
72224
public void setTag(int viewId, int key, Object tag) {
        ViewHelper.setTag(mCacheView, viewId, key, tag);
    }