Emits the is<TAG_NAME> methods and tagName method for determining
        tag state and retrieving human-readable value of tag state, respectively.
961418
def _generate_union_tag_state_funcs(self, union):
        """"""
        for field in union.all_fields:
            enum_field_name = fmt_enum_name(field.name, union)

            with self.block_func(
                    func='is{}'.format(fmt_camel_upper(field.name)),
                    args=[],
                    return_type='BOOL'):
                self.emit('return _tag == {};'.format(enum_field_name))
            self.emit()

        with self.block_func(
                func='tagName', args=[], return_type='NSString *'):
            with self.block('switch (_tag)'):
                for field in union.all_fields:
                    enum_field_name = fmt_enum_name(field.name, union)
                    self.emit('case {}:'.format(enum_field_name))
                    self.emit('   return @"{}";'.format(enum_field_name))
            self.emit()
            self._generate_throw_error('InvalidTag',
                                       '@"Tag has an unknown value."')
        self.emit()
212529
def getElementsByName(self, name):
        '''
            
        '''
        ret = TagCollection()
        if len(self) == 0:
            return ret
        _cmpFunc = lambda tag : bool(tag.name == name)
        for tag in self:
            TagCollection._subset(ret, _cmpFunc, tag)

        return ret
130251
public String getTagValue(String tagName) {
        String value = null;

        if (mReadMethod != null) {
            value = mReadMethod.getTagValue(tagName);
        }
        if (value == null && mWriteMethod != null) {
            value = mWriteMethod.getTagValue(tagName);
        }

        return value;
    }
739087
def method_missing m, *args, &block
      if method_name_is_tag_name? m
        return assign_tag(m, args, &block)
      elsif method_name_is_tag_adder_method? m 
        return extend_tag_list(m, args, &block)
      elsif method_name_is_tag_list_method? m
        return child_tags[m[0..-6].to_sym] ||= []
      elsif method_name_is_attr_accessor_method? m
        return assign_attribute(m[0..-6].to_sym, args, &block)
      end
      super(m, *args, &block)
    end
122858
function checkTagName(node, output) {
  var result = output.result
  var deps = output.deps
  var log = output.log

  var tagName = node.tagName
  var childNodes = node.childNodes || []
  var location = node.__location || {}

  // alias
  if (TAG_NAME_ALIAS_MAP[tagName]) {
    if (tagName !== 'img') { // FIXME: `parse5` autofixes image to img silently
      log.push({
        line: location.line || 1,
        column: location.col || 1,
        reason: 'NOTE: tag name `' + tagName + '` is autofixed to `' + TAG_NAME_ALIAS_MAP[tagName] + '`'
      })
    }
    tagName = TAG_NAME_ALIAS_MAP[tagName]
  }

  if (tagName === 'component') {
    var indexOfIs = -1
    if (node.attrs) {
      node.attrs.forEach(function (attr, index) {
        if (attr.name === 'is') {
          indexOfIs = index
          result.type = tagName = exp(attr.value)
        }
      })
    }
    if (indexOfIs > -1) {
      node.attrs.splice(indexOfIs, 1) // delete `is`
    }
    else {
      result.type = tagName = 'container'
      log.push({
        line: location.line || 1,
        column: location.col || 1,
        reason: 'WARNING: tag `component` should have an `is` attribute, otherwise it will be regarded as a `container`'
      })
    }
  }
  else {
    result.type = tagName
  }

  // deps
  if (deps.indexOf(tagName) < 0 && typeof tagName === 'string') { // FIXME: improve `require` to bundle dynamic binding components
    deps.push(tagName)
  }

  // parent (no any rules yet)

  // child (noChild, textContent)
  if (NO_CHILD_TAG_NAME_LIST.indexOf(tagName) >= 0) {
    if (childNodes.length > 0) {
      log.push({
        line: location.line || 1,
        column: location.col || 1,
        reason: 'ERROR: tag `' + tagName + '` should not have children'
      })
    }
  }
  if (TEXT_CONTENT_TAG_NAME_LIST.indexOf(tagName) >= 0) {
    if (childNodes.length > 1 || (childNodes[0] && childNodes[0].nodeName !== '#text')) {
      log.push({
        line: location.line || 1,
        column: location.col || 1,
        reason: 'ERROR: tag name `' + tagName + '` should just have one text node only'
      })
    }
  }

  // default attr
  if (TAG_DEFAULT_ATTR_MAP[tagName]) {
    Object.keys(TAG_DEFAULT_ATTR_MAP[tagName]).forEach(function (attr) {
      if (attr !== 'append') {
        result.attr = result.attr || {}
        result.attr[attr] = TAG_DEFAULT_ATTR_MAP[tagName][attr]
      }
      else {
        result[attr] = TAG_DEFAULT_ATTR_MAP[tagName][attr]
      }
    })
  }
}
1300348
private static String getTagValueAsString(final ITag tag, final byte[] value) {
		StringBuilder buf = new StringBuilder();

		switch (tag.getTagValueType()) {
		case TEXT:
			buf.append("=");
			buf.append(new String(value));
			break;
		case NUMERIC:
			buf.append("NUMERIC");
			break;
		case BINARY:
			buf.append("BINARY");
			break;
		case MIXED:
			buf.append("=");
			buf.append(getSafePrintChars(value));
			break;
		case DOL:
			buf.append("");
			break;
		default:
			break;
		}

		return buf.toString();
	}
989364
def as_tag(value)
      case true
      when value.tag?
        element(value) ? value : nil
      when value.dicom_name?
        get_tag(value)
      when value.dicom_method?
        get_tag(@names_from_methods[value.to_sym])
      else
        nil
      end
    end
340656
private void checkTagName(String name) {
        if (standardTags.contains(name)) {
            overridenStandardTags.add(name);
        } else {
            if (name.indexOf('.') == -1) {
                potentiallyConflictingTags.add(name);
            }
            unseenCustomTags.add(name);
        }
    }
1079464
def _process_tags(self):
        """"""
        tags = []

        while True:
            tag_bf = unpack_ui16(self._src)
            tag_type = tag_bf >> 6   # upper 10 bits
            if tag_type == 0:
                # the end
                break
            tag_len = tag_bf & 0x3f  # last 6 bits
            if tag_len == 0x3f:
                # the length is the next four bytes!
                tag_len = unpack_ui32(self._src)

            try:
                tag_name = TAG_NAMES[tag_type]
            except KeyError:
                # malformed SWF, create and unknown object with malformed tag
                tag_payload = self._src.read(tag_len)
                _dict = {
                    '__str__': _repr,
                    '__repr__': _repr,
                    'name': 'UnspecifiedObject(tag={!r})'.format(tag_type),
                }
                tag = type("UnknownObject", (SWFObject,), _dict)()
                tag.raw_payload = tag_payload
                tags.append(tag)
                continue

            try:
                tag_meth = getattr(self, "_handle_tag_" + tag_name.lower())
            except AttributeError:
                if self.unknown_alert:
                    raise ValueError("Unknown tag: " + repr(tag_name))

                tag_payload = self._src.read(tag_len)
                _dict = {'__str__': _repr, '__repr__': _repr, 'name': tag_name}
                tag = type("UnknownObject", (SWFObject,), _dict)()
                tag.raw_payload = tag_payload
                tags.append(tag)
                continue

            # we know the tag type, and have the handler, let's process it
            prev_pos = self._src.tell()
            self._src.guard = tag_len
            try:
                with ReadQuantityController(self._src, tag_len):
                    tag = tag_meth()
                assert tag is not None, tag_name
            except ValueError:
                # an attempt to read too much happened; create a failing
                # object with the raw payload
                self._src.guard = None
                self._src.seek(prev_pos)
                tag_payload = self._src.read(tag_len)
                _dict = {'__str__': _repr, '__repr__': _repr, 'name': tag_name}
                tag = type("FailingObject", (SWFObject,), _dict)()
                tag.raw_payload = tag_payload
            tags.append(tag)
        return tags
994237
def __render_tag(info, state):
    
    new_contexts, context_match = get_tag_context(info['tag_key'], state)
    replacement = ''

    if context_match or context_match == 0:
        replacement = context_match
    elif info['tag_key'] == '.':
        replacement = state.context()
    else:
        replacement = ''

    # Call all callables / methods / lambdas / functions
    if replacement and callable(replacement):
        replacement = make_unicode(replacement())

        state.push_tags(state.default_tags)
        replacement = __render(template=replacement, state=state)
        state.pop_tags()

    for i in xrange(new_contexts): state.context.pop()

    if state.escape():
        return html_escape(replacement)
    return replacement
651221
def get_tagvalues(self, tagnames, tagidxs):
        
        values = tuple(getattr(self, tagname)[tagidx + 1]
                       for tagidx, tagname in zip(tagidxs, tagnames))
        return values
139322
def get_tag(self, tag_name, **kwargs):
        
        return self._get_object_by_name(self._TAG_ENDPOINT_SUFFIX,
                                        tag_name,
                                        **kwargs)
230556
def get_actual_tag
      supported_tags = @bbtree.current_node[:definition][:supported_tags]

      supported_tags.each do |tag|
        regex_list = @dictionary[tag][:url_matches]

        regex_list.each do |regex|
          return tag if regex =~ @ti.text
        end
      end
      :tag_not_found
    end
1339100
private boolean tagResource(String resourceId, String tagName) {
		boolean result = false;
		if(! Utils.isEmptyOrWhitespaces(tagName)) {
			Tag tag = new Tag( "Name", tagName );
			CreateTagsRequest ctr = new CreateTagsRequest(Collections.singletonList(resourceId), Arrays.asList( tag ));
			try {
				this.ec2Api.createTags( ctr );
			} catch(Exception e) {
				this.logger.warning("Error tagging resource " + resourceId + " with name=" + tagName + ": " + e);
			}
			result = true;
		}
		return result;
	}
1159740
def tag_mode(self, tag_mode):
        
        allowed_values = ["all", "top", "custom"]  # noqa: E501
        if tag_mode not in allowed_values:
            raise ValueError(
                "Invalid value for `tag_mode` ({0}), must be one of {1}"  # noqa: E501
                .format(tag_mode, allowed_values)
            )

        self._tag_mode = tag_mode
885219
def tag(self):
        
        name_or_id = self.task.tag
        if name_or_id is None:
            return defer.succeed(None)
        if isinstance(name_or_id, StringType):
            return defer.succeed(name_or_id)
        if isinstance(name_or_id, int):
            return self.task.connection.cache.tag_name(name_or_id)
        return defer.fail()
1196976
def tag_value(self, p_key, p_default=None):
        
        return self.tag_values(p_key)[0] if p_key in self.fields['tags'] else p_default