<pre>
Tag to apply to the VM instance during creation.
</pre>

<code>string instance_tag = 2;</code>
423177
public com.google.protobuf.ByteString
      getInstanceTagBytes() {
    java.lang.Object ref = instanceTag_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      instanceTag_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
762819
def list_instances(self, tag_values=None):

        '''
            
        '''

        title = '%s.list_instances' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'tag_values': tag_values
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)
            
    # add tags to method arguments
        kw_args = {}
        tag_text = ''
        if tag_values:
            kw_args = {
                'Filters': [ { 'Name': 'tag-value', 'Values': tag_values } ]
            }
            from labpack.parsing.grammar import join_words
            plural_value = ''
            if len(tag_values) > 1:
                plural_value = 's'
            tag_text = ' with tag value%s %s' % (plural_value, join_words(tag_values))
            
    # request instance details from AWS
        self.iam.printer('Querying AWS region %s for instances%s.' % (self.iam.region_name, tag_text))
        instance_list = []
        try:
            if tag_values:
                response = self.connection.describe_instances(**kw_args)
            else:
                response = self.connection.describe_instances()
        except:
            raise AWSConnectionError(title)

    # repeat request if any instances are currently pending
        response_list = response['Reservations']
        for instance in response_list:
            instance_info = instance['Instances'][0]
            if instance_info['State']['Name'] == 'pending':
                self.check_instance_state(instance_info['InstanceId'])
                try:
                    if tag_values:
                        response = self.connection.describe_instances(**kw_args)
                    else:
                        response = self.connection.describe_instances()
                except:
                    raise AWSConnectionError(title)
                response_list = response['Reservations']

    # populate list of instances with instance details
        for instance in response_list:
            instance_info = instance['Instances'][0]
            state_name = instance_info['State']['Name']
            if state_name not in ('shutting-down', 'terminated'):
                instance_list.append(instance_info['InstanceId'])

    # report results and return details
        if instance_list:
            print_out = 'Found instance'
            if len(instance_list) > 1:
                print_out += 's'
            from labpack.parsing.grammar import join_words
            print_out += ' %s.' % join_words(instance_list)
            self.iam.printer(print_out)
        else:
            self.iam.printer('No instances found.')

        return instance_list
1283508
def process_rename(self, client, tag_value, resource_set):
        
        self.log.info("Renaming tag on %s instances" % (len(resource_set)))
        old_key = self.data.get('old_key')
        new_key = self.data.get('new_key')

        # We have a preference to creating the new tag when possible first
        resource_ids = [r[self.id_key] for r in resource_set if len(
            r.get('Tags', [])) < self.tag_count_max]
        if resource_ids:
            self.create_tag(client, resource_ids, new_key, tag_value)

        self.delete_tag(
            client, [r[self.id_key] for r in resource_set], old_key, tag_value)

        # For resources with 50 tags, we need to delete first and then create.
        resource_ids = [r[self.id_key] for r in resource_set if len(
            r.get('Tags', [])) > self.tag_count_max - 1]
        if resource_ids:
            self.create_tag(client, resource_ids, new_key, tag_value)
1209573
public static Tag getTag(String name) {

        Tag tag = TAGS.get(name);

        if (tag == null) {
            throw new RuntimeException("unknown tag: " + name);
        }

        return tag;
    }
1305005
public static void v(String tag, String msg) {
        if (logger != null && isLoggingEnabled(tag, VERBOSE)) {
            logger.v(tag, msg);
        }
    }
1000028
public int getIdByTag(String tag)
    {
        Integer value = (Integer) table.getValueByKey(tag);
        if (value == null)
            LoggerFactory.getDefaultLogger().error(
                "** " + this.getClass().getName() + ": Tag '" + tag + "' is not defined. **");
        return value.intValue();
    }
226563
def create_tag(self, tag_name):
        
        # Make sure the local repository exists and supports a working tree.
        self.create()
        self.ensure_working_tree()
        # Create the new tag in the local repository.
        logger.info("Creating tag '%s' in %s ..", tag_name, format_path(self.local))
        self.context.execute(*self.get_create_tag_command(tag_name))
123878
public static Tag getParentTag(Tag tag) {
	Statement p = tag.getParent();
	if (p == null) return null;
	p = p.getParent();
	if (p instanceof Tag) return (Tag) p;
	return null;
    }
757352
public List<Tag> getInstanceTags() {
    final DescribeInstancesResult response = ec2
        .describeInstances(new DescribeInstancesRequest()
            .withInstanceIds(Collections.singletonList(instanceIdentity.instanceId)));

    return response.getReservations().stream()
        .flatMap(reservation -> reservation.getInstances().stream())
        .flatMap(instance -> instance.getTags().stream())
        .collect(Collectors.toList());

  }
502181
def tag(tokens)
      !tokens.is_a?(Array) && !tokens.is_a?(String) &&
        raise(ArgumentError, 'tokens must be an instance of String or Array')

      j_instance.tag(tokens.to_java(:String))
    end
867243
function createTag(impl, conf, innerHTML) {
      if ( impl === void 0 ) impl = {};
      if ( conf === void 0 ) conf = {};

      var tag = conf.context || {};
      var opts = extend({}, conf.opts);
      var parent = conf.parent;
      var isLoop = conf.isLoop;
      var isAnonymous = !!conf.isAnonymous;
      var skipAnonymous = settings.skipAnonymousTags && isAnonymous;
      var item = conf.item;
      // available only for the looped nodes
      var index = conf.index;
      // All attributes on the Tag when it's first parsed
      var instAttrs = [];
      // expressions on this type of Tag
      var implAttrs = [];
      var expressions = [];
      var root = conf.root;
      var tagName = conf.tagName || getName(root);
      var isVirtual = tagName === 'virtual';
      var isInline = !isVirtual && !impl.tmpl;
      var dom;

      // make this tag observable
      if (!skipAnonymous) { observable(tag); }
      // only call unmount if we have a valid __TAG_IMPL (has name property)
      if (impl.name && root._tag) { root._tag.unmount(true); }

      // not yet mounted
      define(tag, 'isMounted', false);

      define(tag, '__', {
        impl: impl,
        root: root,
        skipAnonymous: skipAnonymous,
        implAttrs: implAttrs,
        isAnonymous: isAnonymous,
        instAttrs: instAttrs,
        innerHTML: innerHTML,
        tagName: tagName,
        index: index,
        isLoop: isLoop,
        isInline: isInline,
        item: item,
        parent: parent,
        // tags having event listeners
        // it would be better to use weak maps here but we can not introduce breaking changes now
        listeners: [],
        // these vars will be needed only for the virtual tags
        virts: [],
        wasCreated: false,
        tail: null,
        head: null
      });

      // create a unique id to this tag
      // it could be handy to use it also to improve the virtual dom rendering speed
      define(tag, '_riot_id', uid()); // base 1 allows test !t._riot_id
      define(tag, 'root', root);
      extend(tag, { opts: opts }, item);
      // protect the "tags" and "refs" property from being overridden
      define(tag, 'parent', parent || null);
      define(tag, 'tags', {});
      define(tag, 'refs', {});

      if (isInline || isLoop && isAnonymous) {
        dom = root;
      } else {
        if (!isVirtual) { root.innerHTML = ''; }
        dom = mkdom(impl.tmpl, innerHTML, isSvg(root));
      }

      define(tag, 'update', function (data) { return componentUpdate(tag, data, expressions); });
      define(tag, 'mixin', function () {
        var mixins = [], len = arguments.length;
        while ( len-- ) mixins[ len ] = arguments[ len ];

        return componentMixin.apply(void 0, [ tag ].concat( mixins ));
      });
      define(tag, 'mount', function () { return componentMount(tag, dom, expressions, opts); });
      define(tag, 'unmount', function (mustKeepRoot) { return tagUnmount(tag, mustKeepRoot, expressions); });

      return tag
    }
854082
public FaceletTaglibTagType<FaceletTaglibType<T>> getOrCreateTag()
   {
      List<Node> nodeList = childNode.get("tag");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FaceletTaglibTagTypeImpl<FaceletTaglibType<T>>(this, "tag", childNode, nodeList.get(0));
      }
      return createTag();
   }
819753
def add_tag(name, start, stop)
      @attr_tags << InlineTag.new(SM::Attribute.bitmap_for(name), start, stop)
    end
1050388
function Tag() {
        Model.apply(this, arguments);

        /** @member {TagKind} */
        this.kind = TK_STRING;

        /** @member {*} */
        this.value = '';

        /** @member {Model} */
        this.reference = null;

        /** @member {boolean} */
        this.checked = false;

        /** @member {number} */
        this.number = 0;

    }
1047459
public void addTag(Tag tag) {
    set(PackageMetadata.TAGS, concat(getTags(), singletonList(tag)));
  }
131348
static final String createTag(final String name) {
		if (name.length() <= MAX_TAG_LEN) {
			return name;
		}

		final char[] tag = name.toCharArray();
		final int arrayLen = tag.length;
		int len = 0;
		int mark = 0;

		for (int i = 0; i < arrayLen; i++, len++) {
			if (tag[i] == '.') {
				len = mark;

				if (tag[len] != '.') {
					len++;
				}

				mark = len;

				if (i + 1 < arrayLen && tag[i + 1] != '.') {
					mark++;
				}
			}

			tag[len] = tag[i];
		}

		if (len > MAX_TAG_LEN) {
			int i = 0;

			mark--;

			for (int j = 0; j < len; j++) {
				if (tag[j] == '.' && ((j != mark) || (i >= MAX_TAG_LEN - 1))) {
					continue;
				}

				tag[i++] = tag[j];
			}

			len = i;

			if (len > MAX_TAG_LEN) {
				len = MAX_TAG_LEN;
			}
		}

		return new String(tag, 0, len);
	}
533868
public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) {
        try {
            Class<?> customTagClass = null;
            // construct class loader
            String cpString = null;   // make sure env.class.path defaults to dot

            ClassLoader tagClassLoader;
            if (fileManager != null && fileManager.hasLocation(DocumentationTool.Location.TAGLET_PATH)) {
                tagClassLoader = fileManager.getClassLoader(DocumentationTool.Location.TAGLET_PATH);
            } else {
                // do prepends to get correct ordering
                cpString = appendPath(System.getProperty("env.class.path"), cpString);
                cpString = appendPath(System.getProperty("java.class.path"), cpString);
                cpString = appendPath(tagletPath, cpString);
                tagClassLoader = new URLClassLoader(pathToURLs(cpString));
            }

            customTagClass = tagClassLoader.loadClass(classname);
            Method meth = customTagClass.getMethod("register",
                                                   new Class<?>[] {java.util.Map.class});
            Object[] list = customTags.values().toArray();
            Taglet lastTag = (list != null && list.length > 0)
                ? (Taglet) list[list.length-1] : null;
            meth.invoke(null, new Object[] {customTags});
            list = customTags.values().toArray();
            Object newLastTag = (list != null&& list.length > 0)
                ? list[list.length-1] : null;
            if (lastTag != newLastTag) {
                //New taglets must always be added to the end of the LinkedHashMap.
                //If the current and previous last taglet are not equal, that
                //means a new Taglet has been added.
                message.notice("doclet.Notice_taglet_registered", classname);
                if (newLastTag != null) {
                    checkTaglet(newLastTag);
                }
            }
        } catch (Exception exc) {
            message.error("doclet.Error_taglet_not_registered", exc.getClass().getName(), classname);
        }

    }