# Path: kitty/model/low_level/encoder.py
# class StrEncodeEncoder(StrFuncEncoder):
#     '''
#     Encode the string using str.encode function
#     '''
# 
#     def __init__(self, encoding):
#         '''
#         :type encoding: ``str``
#         :param encoding: encoding to be used, should be a valid argument for str.encode
#         '''
#         if encoding == 'hex':
#             func = hexlify
#         elif encoding == 'base64':
#             func = b64encode
#         elif encoding == 'utf-8':
#             func = strToUtf8
#         elif encoding == 'bytes':
#             func = strToBytes
#         elif isinstance(encoding, str):
#             if sys.version_info < (3, 0):
#                 func = py2_str_encoder_func(encoding)
#             else:
#                 raise KittyException('Kitty does not support encoding "%s" on python3' % encoding)
#         else:
#             func = encoding
#         super(StrEncodeEncoder, self).__init__(func)


from base64 import b64decode
from binascii import unhexlify
from kitty.model.low_level.encoder import StrEncodeEncoder
import codecs
import six
        if isinstance(value, Report):
            self._sub_reports[key] = value
            self._data_fields['sub_reports'].append(key)
        else:
            self._data_fields[key] = value

    def get(self, key):
        '''
        Get a value for a given key

        :param key: entry's key
        :return: corresponding value
        '''
        if key in self._data_fields:
            return self._data_fields[key]
        if key in self._sub_reports:
            return self._sub_reports[key]
        return None

    def to_dict(self, encoding='base64'):
        '''
        Return a dictionary version of the report

        :param encoding: required encoding for the string values (default: 'base64')
        :rtype: dictionary
        :return: dictionary representation of the report
        '''
        res = {}
        for k, v in self._data_fields.items():
            if isinstance(v, (bytes, bytearray, six.string_types)):

# Path: kitty/model/low_level/encoder.py
# class StrEncodeEncoder(StrFuncEncoder):
#     '''
#     Encode the string using str.encode function
#     '''
# 
#     def __init__(self, encoding):
#         '''
#         :type encoding: ``str``
#         :param encoding: encoding to be used, should be a valid argument for str.encode
#         '''
#         if encoding == 'hex':
#             func = hexlify
#         elif encoding == 'base64':
#             func = b64encode
#         elif encoding == 'utf-8':
#             func = strToUtf8
#         elif encoding == 'bytes':
#             func = strToBytes
#         elif isinstance(encoding, str):
#             if sys.version_info < (3, 0):
#                 func = py2_str_encoder_func(encoding)
#             else:
#                 raise KittyException('Kitty does not support encoding "%s" on python3' % encoding)
#         else:
#             func = encoding
#         super(StrEncodeEncoder, self).__init__(func)


# Path: kitty/data/report.py
from base64 import b64decode
from binascii import unhexlify
from kitty.model.low_level.encoder import StrEncodeEncoder
import codecs
import six

        if isinstance(value, Report):
            self._sub_reports[key] = value
            self._data_fields['sub_reports'].append(key)
        else:
            self._data_fields[key] = value

    def get(self, key):
        '''
        Get a value for a given key

        :param key: entry's key
        :return: corresponding value
        '''
        if key in self._data_fields:
            return self._data_fields[key]
        if key in self._sub_reports:
            return self._sub_reports[key]
        return None

    def to_dict(self, encoding='base64'):
        '''
        Return a dictionary version of the report

        :param encoding: required encoding for the string values (default: 'base64')
        :rtype: dictionary
        :return: dictionary representation of the report
        '''
        res = {}
        for k, v in self._data_fields.items():
            if isinstance(v, (bytes, bytearray, six.string_types)):

                v = StrEncodeEncoder(encoding).encode(v).tobytes().decode()