# Path: rakuten_ws/compat.py
#     def iteritems(d):
#     def is_bytes(x):
#     def callable(obj):
#     def iteritems(d):
#     def is_bytes(x):
# def to_unicode(obj, encoding='utf-8'):


import re
import requests
from collections import OrderedDict, MutableMapping
from shutil import copyfileobj
from mimetypes import guess_type
from io import BytesIO, open
from xmljson import Parker
from lxml.etree import Element, fromstring, tostring
from .compat import iteritems, to_unicode, is_py2, str, urlparse, pathname2url
from __future__ import unicode_literals







parker = Parker(dict_type=dict)


class PrettyStringRepr(str):
    # Useful for debug
    def __repr__(self):
        if is_py2:
            return to_unicode(self.replace(' \n', '\n').strip()).encode('utf-8')
        else:
            return to_unicode(self.replace(' \n', '\n').strip())


def camelize_dict(data, uppercase_first_letter=False):
    """ Returns a dict with camel case keys.

    >>> d = {'a_simple_key': '1', 'Another_key': '2', 'CamelKey': '3'}
    >>> sorted(camelize_dict(d).keys())
    ['Another_key', 'CamelKey', 'aSimpleKey']
    >>> camelize_dict(d)['aSimpleKey']
    '1'
    """
    new_dict = data.__class__()

# Path: rakuten_ws/compat.py
#     def iteritems(d):
#     def is_bytes(x):
#     def callable(obj):
#     def iteritems(d):
#     def is_bytes(x):
# def to_unicode(obj, encoding='utf-8'):


# Path: rakuten_ws/utils.py
import re
import requests
from collections import OrderedDict, MutableMapping
from shutil import copyfileobj
from mimetypes import guess_type
from io import BytesIO, open
from xmljson import Parker
from lxml.etree import Element, fromstring, tostring
from .compat import iteritems, to_unicode, is_py2, str, urlparse, pathname2url

from __future__ import unicode_literals







parker = Parker(dict_type=dict)


class PrettyStringRepr(str):
    # Useful for debug
    def __repr__(self):
        if is_py2:
            return to_unicode(self.replace(' \n', '\n').strip()).encode('utf-8')
        else:
            return to_unicode(self.replace(' \n', '\n').strip())


def camelize_dict(data, uppercase_first_letter=False):
    """ Returns a dict with camel case keys.

    >>> d = {'a_simple_key': '1', 'Another_key': '2', 'CamelKey': '3'}
    >>> sorted(camelize_dict(d).keys())
    ['Another_key', 'CamelKey', 'aSimpleKey']
    >>> camelize_dict(d)['aSimpleKey']
    '1'
    """
    new_dict = data.__class__()

    for k, v in iteritems(data):