Takes either emoji or code
973584
function name(input) {
  if (FLAG_RE.test(input)) {
    input = flagToCode(input);
  }

  return codeToName(input);
}
957510
def emoticons_filter(content, exclude='', autoescape=None):
    
    esc = autoescape and conditional_escape or (lambda x: x)
    content = mark_safe(replace_emoticons(esc(content), exclude))
    return content
153031
function JsBarcode(element, text, options) {
	var api = new API();

	if (typeof element === "undefined") {
		throw Error("No element to render on was provided.");
	}

	// Variables that will be pased through the API calls
	api._renderProperties = getRenderProperties(element);
	api._encodings = [];
	api._options = defaults$1;
	api._errorHandler = new ErrorHandler(api);

	// If text is set, use the simple syntax (render the barcode directly)
	if (typeof text !== "undefined") {
		options = options || {};

		if (!options.format) {
			options.format = autoSelectBarcode();
		}

		api.options(options)[options.format](text, options).render();
	}

	return api;
}
1340494
function sanitizeHtmlCode(code) {
  return code ? code.replace(/[<>&]/g, tag => tagEntities[tag] || tag) : '';
}
1332796
def code(self, code):
        
        allowed_values = [400, 401, 404]
        if code not in allowed_values:
            raise ValueError(
                "Invalid value for `code` ({0}), must be one of {1}"
                .format(code, allowed_values)
            )

        self._code = code
1205817
function mergeAffixEmoticon(child, index, parent) {
  var children = child.children
  var position
  var node
  var prev

  if (children && children.length !== 0 && index !== 0) {
    position = -1

    while (children[++position]) {
      node = children[position]

      if (node.type === EMOTICON_NODE) {
        prev = parent.children[index - 1]

        prev.children = prev.children.concat(children.slice(0, position + 1))
        child.children = children.slice(position + 1)

        if (node.position && child.position && prev.position) {
          prev.position.end = node.position.end
          child.position.start = node.position.end
        }

        /* Next, iterate over the node again. */
        return index
      }

      if (node.type !== 'WhiteSpaceNode') {
        break
      }
    }
  }
}
607478
def getImageCode(self, appKey):
        

        desc = {
            "name": "SMSImageCodeReslut",
            "desc": " getImageCode 成功返回结果",
            "fields": [{
                "name": "code",
                "type": "Integer",
                "desc": "返回码，200 为正常。"
            }, {
                "name": "url",
                "type": "String",
                "desc": "返回的图片验证码 URL 地址。"
            }, {
                "name": "verifyId",
                "type": "String",
                "desc": "返回图片验证标识 Id。"
            }, {
                "name": "errorMessage",
                "type": "String",
                "desc": "错误信息。"
            }]
        }
        r = self.call_api(
            method=('SMS', 'GET', ''),
            action='/getImgCode.json',
            params={"appKey": appKey})
        return Response(r, desc)
1070825
function getCharset (req) {
  try {
    return contentType.parse(req).parameters.charset.toLowerCase()
  } catch (e) {
    return undefined
  }
}
307629
function(data) {
      try {
        data = data || this.getContent();
        return this.keychain.sign(JSON.stringify(data));
      } catch(e) {
        throw new CError({
          body: {
            code: 'ImATeapot',
            message: 'unable to sign content',
            cause: e
          }
        }).log('body');
      }
    }
480048
public static Emoji getForAlias(String alias) {
    if (alias == null) {
      return null;
    }
    return EMOJIS_BY_ALIAS.get(trimAlias(alias));
  }
282193
function insertfontSmiley(str) {

                    var a = str.split(' ');
                    angular.forEach(icons, function (icon) {
                        for (var i = 0; i < a.length; i++) {
                            if (a[i] === icon.text) {
                                a[i] = '<i class="icon-emoticon" title="' + icon.text + '">' + '&#x' + icon.code + '</i>';
                            }
                        }
                    });
                    return a.join(' ');
                }
414869
def react(self, emojiname):
        
        self._client.react_to_message(
            emojiname=emojiname,
            channel=self._body['channel'],
            timestamp=self._body['ts'])
803992
public static String parse(String emoji_str,int type){
		switch (type) {
		case 1:
			return parseToHtmlHexadecimal(emoji_str);
		case 2:
			return parseToHtmlTag(emoji_str);
		case 3:
			return parseToAliases(emoji_str);
		case 4:
			return parseToHtmlDecimal(emoji_str);
		case 5:
			return removeAllEmojis(emoji_str);
		default:
			return null;
		}
	}
200209
def emojies_in(text)
      (sad_emojies + happy_emojies).map do |emoji|
        text.scan(emoji)
      end.flatten
    end
965407
public static void install(@NonNull final EmojiProvider provider) {
    INSTANCE.categories = checkNotNull(provider.getCategories(), "categories == null");
    INSTANCE.emojiMap.clear();
    INSTANCE.emojiReplacer = provider instanceof EmojiReplacer ? (EmojiReplacer) provider : DEFAULT_EMOJI_REPLACER;

    final List<String> unicodesForPattern = new ArrayList<>(GUESSED_UNICODE_AMOUNT);

    final int categoriesSize = INSTANCE.categories.length;
    //noinspection ForLoopReplaceableByForEach
    for (int i = 0; i < categoriesSize; i++) {
      final Emoji[] emojis = checkNotNull(INSTANCE.categories[i].getEmojis(), "emojies == null");

      final int emojisSize = emojis.length;
      //noinspection ForLoopReplaceableByForEach
      for (int j = 0; j < emojisSize; j++) {
        final Emoji emoji = emojis[j];
        final String unicode = emoji.getUnicode();
        final List<Emoji> variants = emoji.getVariants();

        INSTANCE.emojiMap.put(unicode, emoji);
        unicodesForPattern.add(unicode);

        //noinspection ForLoopReplaceableByForEach
        for (int k = 0; k < variants.size(); k++) {
          final Emoji variant = variants.get(k);
          final String variantUnicode = variant.getUnicode();

          INSTANCE.emojiMap.put(variantUnicode, variant);
          unicodesForPattern.add(variantUnicode);
        }
      }
    }

    if (unicodesForPattern.isEmpty()) {
      throw new IllegalArgumentException("Your EmojiProvider must at least have one category with at least one emoji.");
    }

    // We need to sort the unicodes by length so the longest one gets matched first.
    Collections.sort(unicodesForPattern, STRING_LENGTH_COMPARATOR);

    final StringBuilder patternBuilder = new StringBuilder(GUESSED_TOTAL_PATTERN_LENGTH);

    final int unicodesForPatternSize = unicodesForPattern.size();
    for (int i = 0; i < unicodesForPatternSize; i++) {
      patternBuilder.append(Pattern.quote(unicodesForPattern.get(i))).append('|');
    }

    final String regex = patternBuilder.deleteCharAt(patternBuilder.length() - 1).toString();
    INSTANCE.emojiPattern = Pattern.compile(regex);
    INSTANCE.emojiRepetitivePattern = Pattern.compile('(' + regex + ")+");
  }
1005295
async def wait_loop(self):
        

        start, back, forward, end, close = self.emojis

        def check(payload: discord.RawReactionActionEvent):
            """
            Checks if this reaction is related to the paginator interface.
            """

            owner_check = not self.owner or payload.user_id == self.owner.id

            emoji = payload.emoji
            if isinstance(emoji, discord.PartialEmoji) and emoji.is_unicode_emoji():
                emoji = emoji.name

            return payload.message_id == self.message.id and \
                emoji and emoji in self.emojis and \
                payload.user_id != self.bot.user.id and owner_check

        try:
            while not self.bot.is_closed():
                payload = await self.bot.wait_for('raw_reaction_add', check=check, timeout=self.timeout)

                emoji = payload.emoji
                if isinstance(emoji, discord.PartialEmoji) and emoji.is_unicode_emoji():
                    emoji = emoji.name

                if emoji == close:
                    await self.message.delete()
                    return

                if emoji == start:
                    self._display_page = 0
                elif emoji == end:
                    self._display_page = self.page_count - 1
                elif emoji == back:
                    self._display_page -= 1
                elif emoji == forward:
                    self._display_page += 1

                self.bot.loop.create_task(self.update())

                try:
                    await self.message.remove_reaction(payload.emoji, discord.Object(id=payload.user_id))
                except discord.Forbidden:
                    pass

        except asyncio.TimeoutError:
            if self.delete_message:
                return await self.message.delete()

            for emoji in filter(None, self.emojis):
                try:
                    await self.message.remove_reaction(emoji, self.message.guild.me)
                except (discord.Forbidden, discord.NotFound):
                    pass
916066
def reload(filename=None,
        url=r"https://raw.githubusercontent.com/googlei18n/emoji4unicode/master/data/emoji4unicode.xml",
        loader_class=None):
    """
    if loader_class is None:
        loader_class = loader.Loader
    global _loader
    _loader = loader_class()
    _loader.load(filename, url)