(string)
Returns the Emoji Version of the emoji.
      See http://www.unicode.org/reports/tr51/#Versioning for more information.
        >>> emoji.version("😁")
        >>> 0.6
        >>> emoji.version(":butterfly:")
        >>> 3

    :param string: An emoji or a text containig an emoji
    :raises ValueError: if ``string`` does not contain an emoji
Returns the Emoji Version of the emoji.
      See http://www.unicode.org/reports/tr51/#Versioning for more information.
        >>> emoji.version("😁")
        >>> 0.6
        >>> emoji.version(":butterfly:")
        >>> 3
Returns the Emoji Version of the emoji . See http : // www . unicode . org / reports / tr51 / #Versioning for more information . >>> emoji . version ( 😁 ) >>> 0 . 6 >>> emoji . version ( : butterfly : ) >>> 3
def version(string):
    """Returns the Emoji Version of the emoji.
      See http://www.unicode.org/reports/tr51/#Versioning for more information.
        >>> emoji.version("😁")
        >>> 0.6
        >>> emoji.version(":butterfly:")
        >>> 3

    :param string: An emoji or a text containig an emoji
    :raises ValueError: if ``string`` does not contain an emoji
    """

    # Try dictionary lookup
    if string in unicode_codes.EMOJI_DATA:
        return unicode_codes.EMOJI_DATA[string]['E']

    if string in unicode_codes.EMOJI_UNICODE['en']:
        emj_code = unicode_codes.EMOJI_UNICODE['en'][string]
        if emj_code in unicode_codes.EMOJI_DATA:
            return unicode_codes.EMOJI_DATA[emj_code]['E']

    # Try to find first emoji in string
    version = []

    def f(e, emoji_data):
        version.append(emoji_data['E'])
        return ''
    replace_emoji(string, replace=f, version=-1)
    if version:
        return version[0]
    emojize(string, use_aliases=True, version=-1, handle_version=f)
    if version:
        return version[0]
    for lang_code in unicode_codes.EMOJI_UNICODE:
        emojize(string, language=lang_code, version=-1, handle_version=f)
        if version:
            return version[0]

    raise ValueError("No emoji found in string")
def version ( string ) : # Try dictionary lookup if string in unicode_codes . EMOJI_DATA : return unicode_codes . EMOJI_DATA [ string ] [ 'E' ] if string in unicode_codes . EMOJI_UNICODE [ 'en' ] : emj_code = unicode_codes . EMOJI_UNICODE [ 'en' ] [ string ] if emj_code in unicode_codes . EMOJI_DATA : return unicode_codes . EMOJI_DATA [ emj_code ] [ 'E' ] # Try to find first emoji in string version = [ ] def f ( e , emoji_data ) : version . append ( emoji_data [ 'E' ] ) return '' replace_emoji ( string , replace = f , version = - 1 ) if version : return version [ 0 ] emojize ( string , use_aliases = True , version = - 1 , handle_version = f ) if version : return version [ 0 ] for lang_code in unicode_codes . EMOJI_UNICODE : emojize ( string , language = lang_code , version = - 1 , handle_version = f ) if version : return version [ 0 ] raise ValueError ( "No emoji found in string" )