# Path: battlenet/enums.py
# RACE = {
#     1: 'Human',
#     2: 'Orc',
#     3: 'Dwarf',
#     4: 'Night Elf',
#     5: 'Undead',
#     6: 'Tauren',
#     7: 'Gnome',
#     8: 'Troll',
#     9: 'Goblin',
#     10: 'Blood Elf',
#     11: 'Draenei',
#     22: 'Worgen',
# }
# 
# CLASS = {
#     1: 'Warrior',
#     2: 'Paladin',
#     3: 'Hunter',
#     4: 'Rogue',
#     5: 'Priest',
#     7: 'Shaman',
#     8: 'Mage',
#     9: 'Warlock',
#     11: 'Druid',
#     6: 'Death Knight',
# }
# 
# QUALITY = {
#     1: 'Common',
#     2: 'Uncommon',
#     3: 'Rare',
#     4: 'Epic',
#     5: 'Legendary',
# }
# 
# RACE_TO_FACTION = {
#     1: 'Alliance',
#     2: 'Horde',
#     3: 'Alliance',
#     4: 'Alliance',
#     5: 'Horde',
#     6: 'Horde',
#     7: 'Alliance',
#     8: 'Horde',
#     9: 'Horde',
#     10: 'Horde',
#     11: 'Alliance',
#     22: 'Alliance',
# }
# 
# Path: battlenet/utils.py
# def make_icon_url(region, icon, size='large'):
#     if not icon:
#         return ''
# 
#     if size == 'small':
#         size = 18
#     else:
#         size = 56
# 
#     return 'http://%s.media.blizzard.com/wow/icons/%d/%s.jpg' % (region, size, icon)
# 
# def normalize(name):
#     if not isinstance(name, unicode):
#         name = name.decode('utf8')
# 
#     return unicodedata.normalize('NFKC', name).encode('utf8')
# 
# def make_connection():
#     if not hasattr(make_connection, 'Connection'):
#         from .connection import Connection
#         make_connection.Connection = Connection
# 
#     return make_connection.Connection()


import operator
import collections
import datetime
    import simplejson as json
    import json
from .enums import RACE, CLASS, QUALITY, RACE_TO_FACTION
from .utils import make_icon_url, normalize, make_connection
    JEWELCRATING = 'Jewelcrafting'
    LEATHERWORKING = 'Leatherworking'
    MINING = 'Mining'
    Skinning = 'Skinning'
    TAILORING = 'Tailoring'

    ARCHAEOLOGY = 'Archaeology'
    COOKING = 'Cooking'
    FIRST_AID = 'First Aid'
    FISHING = 'Fishing'

    STATS = 'stats'
    TALENTS = 'talents'
    ITEMS = 'items'
    REPUTATIONS = 'reputation'
    TITLES = 'titles'
    PROFESSIONS = 'professions'
    APPEARANCE = 'appearance'
    COMPANIONS = 'companions'
    MOUNTS = 'mounts'
    GUILD = 'guild'
    QUESTS = 'quests'
    PETS = 'pets'
    PROGRESSION = 'progression'
    ACHIEVEMENTS = 'achievements'
    ALL_FIELDS = [STATS, TALENTS, ITEMS, REPUTATIONS, TITLES, PROFESSIONS,
                  APPEARANCE, COMPANIONS, MOUNTS, GUILD, QUESTS, PETS,
                  PROGRESSION, ACHIEVEMENTS]

    def __init__(self, region, realm=None, name=None, data=None, fields=None, connection=None):

# Path: battlenet/enums.py
# RACE = {
#     1: 'Human',
#     2: 'Orc',
#     3: 'Dwarf',
#     4: 'Night Elf',
#     5: 'Undead',
#     6: 'Tauren',
#     7: 'Gnome',
#     8: 'Troll',
#     9: 'Goblin',
#     10: 'Blood Elf',
#     11: 'Draenei',
#     22: 'Worgen',
# }
# 
# CLASS = {
#     1: 'Warrior',
#     2: 'Paladin',
#     3: 'Hunter',
#     4: 'Rogue',
#     5: 'Priest',
#     7: 'Shaman',
#     8: 'Mage',
#     9: 'Warlock',
#     11: 'Druid',
#     6: 'Death Knight',
# }
# 
# QUALITY = {
#     1: 'Common',
#     2: 'Uncommon',
#     3: 'Rare',
#     4: 'Epic',
#     5: 'Legendary',
# }
# 
# RACE_TO_FACTION = {
#     1: 'Alliance',
#     2: 'Horde',
#     3: 'Alliance',
#     4: 'Alliance',
#     5: 'Horde',
#     6: 'Horde',
#     7: 'Alliance',
#     8: 'Horde',
#     9: 'Horde',
#     10: 'Horde',
#     11: 'Alliance',
#     22: 'Alliance',
# }
# 
# Path: battlenet/utils.py
# def make_icon_url(region, icon, size='large'):
#     if not icon:
#         return ''
# 
#     if size == 'small':
#         size = 18
#     else:
#         size = 56
# 
#     return 'http://%s.media.blizzard.com/wow/icons/%d/%s.jpg' % (region, size, icon)
# 
# def normalize(name):
#     if not isinstance(name, unicode):
#         name = name.decode('utf8')
# 
#     return unicodedata.normalize('NFKC', name).encode('utf8')
# 
# def make_connection():
#     if not hasattr(make_connection, 'Connection'):
#         from .connection import Connection
#         make_connection.Connection = Connection
# 
#     return make_connection.Connection()


# Path: battlenet/things.py
import operator
import collections
import datetime
    import simplejson as json
    import json
from .enums import RACE, CLASS, QUALITY, RACE_TO_FACTION
from .utils import make_icon_url, normalize, make_connection

    JEWELCRATING = 'Jewelcrafting'
    LEATHERWORKING = 'Leatherworking'
    MINING = 'Mining'
    Skinning = 'Skinning'
    TAILORING = 'Tailoring'

    ARCHAEOLOGY = 'Archaeology'
    COOKING = 'Cooking'
    FIRST_AID = 'First Aid'
    FISHING = 'Fishing'

    STATS = 'stats'
    TALENTS = 'talents'
    ITEMS = 'items'
    REPUTATIONS = 'reputation'
    TITLES = 'titles'
    PROFESSIONS = 'professions'
    APPEARANCE = 'appearance'
    COMPANIONS = 'companions'
    MOUNTS = 'mounts'
    GUILD = 'guild'
    QUESTS = 'quests'
    PETS = 'pets'
    PROGRESSION = 'progression'
    ACHIEVEMENTS = 'achievements'
    ALL_FIELDS = [STATS, TALENTS, ITEMS, REPUTATIONS, TITLES, PROFESSIONS,
                  APPEARANCE, COMPANIONS, MOUNTS, GUILD, QUESTS, PETS,
                  PROGRESSION, ACHIEVEMENTS]

    def __init__(self, region, realm=None, name=None, data=None, fields=None, connection=None):

        self.region = region