Generate clickable map tags if clickable item exists.

        If not exists, this only returns empty string.
480232
def generate_clickable_map(self):
        # type: () -> unicode
        
        if self.clickable:
            return '\n'.join([self.content[0]] + self.clickable + [self.content[-1]])
        else:
            return ''
395542
private static Map<Tag, String> createTags(String ufsName, UfsStatus status) {
    Map<Tag, String> tagMap = new HashMap<>();
    tagMap.put(Tag.UFS, ufsName);
    tagMap.put(Tag.OWNER, status.getOwner());
    tagMap.put(Tag.GROUP, status.getGroup());
    tagMap.put(Tag.MODE, String.valueOf(status.getMode()));
    if (status instanceof UfsFileStatus) {
      tagMap.put(Tag.TYPE, Type.FILE.name());
      tagMap.put(Tag.CONTENT_HASH, ((UfsFileStatus) status).getContentHash());
    } else {
      tagMap.put(Tag.TYPE, Type.DIRECTORY.name());
    }
    return tagMap;
  }
689081
def tag_map(self):
        '''  '''
        tm = dd(list)
        for tag in self.__tags:
            tm[tag.tagtype].append(tag)
        return tm
235925
function (listTag) {
                var
                    tag,
                    len = this._openedTags.length;
                while (len) {
                    tag = this._openedTags.pop();
                    --len;
                    this._output("</" + tag + ">");
                    if ("li" === tag) {
                        break;
                    }
                }
                if (len) {
                    tag = this._openedTags[len - 1];
                    if (tag !== listTag) {
                        this._openedTags.pop();
                        this._output("</" + tag + ">");
                    } else {
                        return;
                    }
                }
                this._openTag(listTag);
            }
948802
function getOpenTagParams(tag, tmplRule) {
  var pattern = tmplRule.openTagParams,
      matchArr,
      ret;

  while (matchArr = pattern.exec(tag)) {
    var key = matchArr[1];

    if (key === '/') {
      //If match to the last of "/", then continue the loop.
      continue;
    }

    if (!ret) {
      ret = [];
    }

    var value = matchArr[8],
        onlyBrace = matchArr[4] != null ? matchArr[4] : matchArr[6],
        onlyKey = false;

    if (value != null) {
      value = clearQuot(value); //Remove quotation marks
    } else {
      value = key; //Match to Similar to "checked" or "disabled" attribute.

      if (!onlyBrace) {
        onlyKey = true;
      }
    } //Removed at the end of "/>", ">" or "/".


    if (!matchArr[9] && !matchArr[10]) {
      if (/\/>$/.test(value)) {
        value = value.substr(0, value.length - 2);
      } else if (/>$/.test(value) || /\/$/.test(value)) {
        value = value.substr(0, value.length - 1);
      }
    } //Transform special key


    var hasColon = void 0;

    if (key[0] === ':') {
      key = key.substr(1);
      hasColon = true;
    }

    ret.push({
      key: key,
      value: value,
      onlyBrace: onlyBrace,
      hasColon: hasColon,
      onlyKey: onlyKey
    });
  }

  return ret;
}
885311
def get_resource_tag_map(self, r_type, ids):
        
        manager = self.manager.get_resource_manager(r_type)
        r_id = manager.resource_type.id
        # TODO only fetch resource with the given ids.
        return {
            r[r_id]: {t['Key']: t['Value'] for t in r.get('Tags', [])}
            for r in manager.resources() if r[r_id] in ids
        }
1003126
function(items) {
        var selectivity = this.selectivity;
        return items
            .map(function(item) {
                var result = selectivity.template(item.id ? 'resultItem' : 'resultLabel', item);
                if (item.children) {
                    result += selectivity.template('resultChildren', {
                        childrenHtml: this.renderItems(item.children)
                    });
                }
                return result;
            }, this)
            .join('');
    }
123956
def _tag_dict_values(self, map_node):
        
        new_values = []
        for key, value in map_node.value:
            if not value.tag.endswith(':str'):
                new_values.append((key, value,))
                continue

            augmented_string = yaml.nodes.MappingNode(
                tag=map_node.tag,
                value=[
                    self._create_key_value_pair_for_mapping_node_value(
                        '__value__',
                        value.value,
                        'tag:yaml.org,2002:str',
                    ),
                    self._create_key_value_pair_for_mapping_node_value(
                        '__line__',
                        str(value.__line__),
                        'tag:yaml.org,2002:int',
                    ),
                ],
            )

            new_values.append((key, augmented_string,))

        output = yaml.nodes.MappingNode(
            tag=map_node.tag,
            value=new_values,
            start_mark=map_node.start_mark,
            end_mark=map_node.end_mark,
            flow_style=map_node.flow_style,
        )
        return output
525504
def tag(context: click.Context, file_id: int, tags: List[str]):
    """"""
    file_obj = context.obj['db'].file_(file_id)
    if file_obj is None:
        print(click.style('unable to find file', fg='red'))
        context.abort()
    for tag_name in tags:
        tag_obj = context.obj['db'].tag(tag_name)
        if tag_obj is None:
            tag_obj = context.obj['db'].new_tag(tag_name)
        elif tag_obj in file_obj.tags:
            print(click.style(f"{tag_name}: tag already added", fg='yellow'))
            continue
        file_obj.tags.append(tag_obj)
    context.obj['db'].commit()
    all_tags = (tag.name for tag in file_obj.tags)
    print(click.style(f"file tags: {', '.join(all_tags)}", fg='blue'))
1268759
public void addLegacyTagIdMappings(String tagId, String tagName)
    {
        assert (tagId != null) : "The parameter 'tagId' must not be null";
        assert (tagName != null) : "The parameter 'tagName' must not be null";

        if (_idMap == null) {
            _idMap = new HashMap/*<String, String>*/();
        }

        assert (_idMap != null) : "_idMap should not be null";
        _idMap.put(tagId, tagName);
    }
1353867
public static String getOpeningTag(String tag, Map<String, String> attributes)
	{
		StringBuffer _result = new StringBuffer();
		Map<String, String> _attributes = (null != attributes) ? attributes : EMPTY_MAP;
		return doAppendOpeningTag(_result, tag, _attributes).toString();
	}
191363
function mapItem (item) {
  const title = item.pagemap.metatags[0]['og:title'] ||
                item.pagemap.metatags[0]['dc.title'] ||
                item.title

  return {
    title,
    link: item.link,
    date: item.pagemap.metatags[0].date,
    image: item.pagemap.cse_image[0].src,
    author: item.pagemap.metatags[0].author
  }
}
82873
def tag(self, name, attrs=None, selfclosing=None):
        """"""
        if self.disable_tags > 0:
            return

        if name in self.linkable_tags and attrs and len(attrs) > 0:
            for attrib in attrs:
                if attrib[0] in self.linkable_attrs:
                    attrib[1] = INTERNAL_LINK.sub('{\g<1>}', attrib[1])

        super().tag(name, attrs, selfclosing)
1176055
function(item) {
  var result = {};

  _.each(item, function(value, key) {
    if (fix[key]) {
      result[key] = parseItem(fix[key](value));
    } else if (key === 'Tags') {
      result[key] = parseTags(value);
    } else {
      result[key] = parseItem(value);
    }
  });

  return result;
}
1295176
def create_or_update_tags(self, tags):
        
        params = {}
        for i, tag in enumerate(tags):
            tag.build_params(params, i+1)
        return self.get_status('CreateOrUpdateTags', params, verb='POST')
793016
function () {
		if (this.options.clickable) {
			if (L.Browser.svg || !L.Browser.vml) {
				L.DomUtil.addClass(this._path, 'leaflet-clickable');
			}

			L.DomEvent.on(this._container, 'click', this._onMouseClick, this);

			var events = ['dblclick', 'mousedown', 'mouseover',
			              'mouseout', 'mousemove', 'contextmenu'];
			for (var i = 0; i < events.length; i++) {
				L.DomEvent.on(this._container, events[i], this._fireMouseEvent, this);
			}
		}
	}
684120
Map<String, String> stringToTags(String tagsmapstring) {
        String[] sb = tagsmapstring.split("\\r");
        Map<String, String> map = new HashMap<>();
        for (String key : sb) {
            if (key.contains("=")) {
                String[] set = key.split("=");
                if (set.length == 2)
                    map.put(set[0], set[1]);
            }
        }
        return map;
    }