Create a new tag instance.
429509
public static Tag newTag(String key, String value) {
    Tag newTag = new BasicTag(intern(key), intern(value));
    return intern(newTag);
  }
695831
def create_ref_tag(tag_name, name, object_name)
      @tags << Tags::RefTagList.new(tag_name, P(object, object_name), name)
    end
62334
def add_tags(self, *tags):
        
        self.tags.extend([
            Tag(name=tag) for tag in tags
        ])
368069
function createTagWithClass (className, tagName) {
  tagName = tagName || 'div'
  let tag = document.createElement(tagName)
  tag.className = className || ''
  return tag
}
881211
def _init_tag(self, tag):
        
        self._element = tag

        self._parseIsTag()
        self._parseIsComment()

        if not self._istag or self._iscomment:
            self._tagname = self._element
        else:
            self._parseTagName()

        if self._iscomment or not self._istag:
            return

        self._parseIsEndTag()
        self._parseIsNonPairTag()

        if self._istag and (not self._isendtag) or "=" in self._element:
            self._parseParams()
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))
1294911
def _create_child(self, tag):
        """"""
        return etree.SubElement(self._root, self._get_namespace_tag(tag))
430602
def with_tag(tag)
      if context.tags.include?(tag)
        self.class.new(context: context, tag: tag)
      else
        raise TagNotFound.new("No such tag '#{tag}'")
      end
    end
1355829
def create(cls, uri, tlp_level=0, tags=[]):
        
        return cls._create(uri=uri, tlp_level=tlp_level, tags=tags)
148834
public static function create($tagName, $content = '') {
		if (isset(self::$tagClassMap[$tagName])) {
			$class = self::$tagClassMap[$tagName];
			return new $class($content);
		} else {
			return new UnknownTag($tagName, $content);
		}
	}
179861
def tag_instance(self, instance_id, tag_list):

        '''
            
        '''

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

    # validate inputs
        input_fields = {
            'instance_id': instance_id,
            'tag_list': tag_list
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
    
    # retrieve tag list of instance
        self.iam.printer_on = False
        instance_details = self.read_instance(instance_id)
        self.iam.printer_on = True
        old_tags = instance_details['tags']
    
    # determine tags to remove
        delete_list = []
        tag_map = {}
        for tag in tag_list:
            tag_map[tag['key']] = tag['value']
        for tag in old_tags:
            if tag['key'] not in tag_map.keys():
                delete_list.append(tag)
            elif tag['value'] != tag_map[tag['key']]:
                delete_list.append(tag)

    # convert tag list to camelcase
        delete_list = self.iam.prepare(delete_list)
        tag_list = self.iam.prepare(tag_list)
    
    # remove tags from instance
        if delete_list:
            try:
                delete_kwargs = {
                    'Resources': [ instance_id ],
                    'Tags': delete_list
                }
                self.connection.delete_tags(**delete_kwargs)
            except:
                AWSConnectionError(title)
            
    # tag instance with updated tags
        try:
            create_kwargs = {
                'Resources': [ instance_id ],
                'Tags': tag_list
            }
            response = self.connection.create_tags(**create_kwargs)
        except:
            raise AWSConnectionError(title)
        
        return response
83373
function createDom(tagName, opt_className) {
  var element = document.createElement(tagName);
  if (opt_className) {
    element.className = opt_className;
  }
  return element;
}
742498
def create(context, name):
    

    result = tag.create(context, name=name)
    utils.format_output(result, context.format)
749606
def _make_tempy_tag(self, tag, attrs, void):
        """"""
        tempy_tag_cls = getattr(self.tempy_tags, tag.title(), None)
        if not tempy_tag_cls:
            unknow_maker = [self.unknown_tag_maker, self.unknown_tag_maker.Void][void]
            tempy_tag_cls = unknow_maker[tag]
        attrs = {Tag._TO_SPECIALS.get(k, k): v or True for k, v in attrs}
        tempy_tag = tempy_tag_cls(**attrs)
        if not self.current_tag:
            self.result.append(tempy_tag)
            if not void:
                self.current_tag = tempy_tag
        else:
            if not tempy_tag._void:
                self.current_tag(tempy_tag)
                self.current_tag = self.current_tag.childs[-1]
1368525
def tag_instance(instance_id, **tags):
    """"""
    logger.debug("Got request to add tags %s to instance %s."
                 % (str(tags), instance_id))
    ec2 = boto3.resource('ec2')
    instance = ec2.Instance(instance_id)

    # Remove None's from `tags`
    filtered_tags = {k: v for k, v in tags.items() if v and k}

    # Check for existing tags
    if instance.tags is not None:
        existing_tags = {tag.get('Key'): tag.get('Value')
                         for tag in instance.tags}
        logger.debug("Ignoring existing tags; %s" % str(existing_tags))
        for tag_key in existing_tags.keys():
            filtered_tags.pop(tag_key, None)

    # If we have new tags to add, add them.
    tag_list = [{'Key': k, 'Value': v} for k, v in filtered_tags.items()]
    if len(tag_list):
        logger.info('Adding project tags "%s" to instance %s'
                    % (filtered_tags, instance_id))
        instance.create_tags(Tags=tag_list)
    else:
        logger.info('No new tags from: %s' % str(tags))
    return
1147994
def set_tag(self, namespace, repository, tag, image_id):
        """"""
        return self._http_call(self.TAGS + '/' + tag, put, data=image_id,
                               namespace=namespace, repository=repository)
304813
def add_tag(self, task, params={}, **options): 
        
        path = "/tasks/%s/addTag" % (task)
        return self.client.post(path, params, **options)