# Path: celestia/utility/enum.py
# def enum(*args, **kwargs):
#     enums = dict(zip(args, range(len(args))), **kwargs)
#     enums['map'] = copy.copy(enums)
#     enums['rmap'] = {}
#     for k,v in enums.items():
#         try:
#             enums['rmap'][v] = k
#         except TypeError:
#             pass
#     return type('Enum', (), enums)
# 
# Path: celestia/utility/defaultordereddict.py
# class DefaultOrderedDict(OrderedDict):
#     def __init__(self, default_factory=None, *a, **kw):
#         if (default_factory is not None and
#             not isinstance(default_factory, Callable)):
#             raise TypeError('first argument must be callable')
#         OrderedDict.__init__(self, *a, **kw)
#         self.default_factory = default_factory
# 
#     def __getitem__(self, key):
#         try:
#             return OrderedDict.__getitem__(self, key)
#         except KeyError:
#             return self.__missing__(key)
# 
#     def __missing__(self, key):
#         if self.default_factory is None:
#             raise KeyError(key)
#         self[key] = value = self.default_factory()
#         return value
# 
#     def __reduce__(self):
#         if self.default_factory is None:
#             args = tuple()
#         else:
#             args = self.default_factory,
#         return type(self), args, None, None, self.items()
# 
#     def copy(self):
#         return self.__copy__()
# 
#     def __copy__(self):
#         return type(self)(self.default_factory, self)
# 
#     def __deepcopy__(self, memo):
#         import copy
#         return type(self)(self.default_factory,
#                           copy.deepcopy(self.items()))
# 
#     def __repr__(self):
#         return 'OrderedDefaultDict(%s, %s)' % (self.default_factory,
#                                                OrderedDict.__repr__(self))


from collections import defaultdict, OrderedDict
from .enum import enum
from .defaultordereddict import DefaultOrderedDict
                                    if ID in not_owned])

    def items(self):
        return self._ponies.items()

    def values(self):
        return self._ponies.values()

    def keys(self):
        return self._ponies.keys()

    def __contains__(self, item):
        return item in self._ponies

    def __isub__(self, pony_id):
        self._ponies.pop(pony_id, None)
        return self

    def remove(self, pony_id):
        self -= pony_id


class Inventory(object):
    def __init__(self, tag, xmlobj):
        self._tag = tag
        self._xmlobj = xmlobj
        self._ponies = None
        self._decorations = None

    def _populate(self, prefix):

# Path: celestia/utility/enum.py
# def enum(*args, **kwargs):
#     enums = dict(zip(args, range(len(args))), **kwargs)
#     enums['map'] = copy.copy(enums)
#     enums['rmap'] = {}
#     for k,v in enums.items():
#         try:
#             enums['rmap'][v] = k
#         except TypeError:
#             pass
#     return type('Enum', (), enums)
# 
# Path: celestia/utility/defaultordereddict.py
# class DefaultOrderedDict(OrderedDict):
#     def __init__(self, default_factory=None, *a, **kw):
#         if (default_factory is not None and
#             not isinstance(default_factory, Callable)):
#             raise TypeError('first argument must be callable')
#         OrderedDict.__init__(self, *a, **kw)
#         self.default_factory = default_factory
# 
#     def __getitem__(self, key):
#         try:
#             return OrderedDict.__getitem__(self, key)
#         except KeyError:
#             return self.__missing__(key)
# 
#     def __missing__(self, key):
#         if self.default_factory is None:
#             raise KeyError(key)
#         self[key] = value = self.default_factory()
#         return value
# 
#     def __reduce__(self):
#         if self.default_factory is None:
#             args = tuple()
#         else:
#             args = self.default_factory,
#         return type(self), args, None, None, self.items()
# 
#     def copy(self):
#         return self.__copy__()
# 
#     def __copy__(self):
#         return type(self)(self.default_factory, self)
# 
#     def __deepcopy__(self, memo):
#         import copy
#         return type(self)(self.default_factory,
#                           copy.deepcopy(self.items()))
# 
#     def __repr__(self):
#         return 'OrderedDefaultDict(%s, %s)' % (self.default_factory,
#                                                OrderedDict.__repr__(self))


# Path: celestia/utility/utility.py
from collections import defaultdict, OrderedDict
from .enum import enum
from .defaultordereddict import DefaultOrderedDict

                                    if ID in not_owned])

    def items(self):
        return self._ponies.items()

    def values(self):
        return self._ponies.values()

    def keys(self):
        return self._ponies.keys()

    def __contains__(self, item):
        return item in self._ponies

    def __isub__(self, pony_id):
        self._ponies.pop(pony_id, None)
        return self

    def remove(self, pony_id):
        self -= pony_id


class Inventory(object):
    def __init__(self, tag, xmlobj):
        self._tag = tag
        self._xmlobj = xmlobj
        self._ponies = None
        self._decorations = None

    def _populate(self, prefix):

        res = DefaultOrderedDict(list)