# Path: twimp/amf0.py
# ZERO = datetime.timedelta(0)
# (MARK_NUMBER, MARK_BOOL, MARK_STRING, MARK_OBJECT, MARK_MOVIECLIP, MARK_NULL,
#  MARK_UNDEFINED, MARK_REFERENCE, MARK_ECMA_ARRAY, MARK_OBJECT_END,
#  MARK_STRICT_ARRAY, MARK_DATE, MARK_LONG_STRING, MARK_UNSUPPORTED,
#  MARK_RECORDSET, MARK_XML_DOCUMENT, MARK_TYPED_OBJECT,
#  MARK_AVMPLUS_OBJECT) = range(0x12)
# class UTC(datetime.tzinfo):
# class OrderedDict(DictMixin, object):
# class OrderedObject(OrderedDict):
# class DecoderError(ValueError):
# class EncoderError(ValueError):
# class UndefinedType(object):
# class Object(OrderedObject):
# class Reference(object):
# class ECMAArray(OrderedDict):
# class XMLDocument(unicode):
#     def utcoffset(self, dt):
#     def tzname(self, dt):
#     def dst(self, dt):
#     def __init__(self, other=None, **kw):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def __iter__(self):
#     def __contains__(self, key):
#     def __len__(self):
#         def __hash__(self):
#     def keys(self):
#     def iteritems(self):
#     def copy(self):
#     def __repr__(self):
#     def __init__(self, other=None, **kw):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __delattr__(self, name):
#     def copy(self):
#     def s(self, **kw):
#     def __repr__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __repr__(self):
#     def __init__(self, index):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __repr__(self):
# def _decode_marker(s):
# def _decode_number(s):
# def _decode_boolean(s):
# def _decode_any_string(s, unpacker):
# def _decode_string(s):
# def _decode_object_like(s, setter):
# def _decode_object(s):
# def _decode_null(s):
# def _decode_undefined(s):
# def _decode_reference(s):
# def _decode_ecma_array(s):
# def _decode_strict_array(s):
# def _decode_date(s):
# def _decode_long_string(s):
# def _decode_xml_document(s):
# def _decode_typed_object(s):
# def _decode_unsupported(s):
# def _decode_single(s, type_dict=decoders):
# def _decode(s, type_dict=decoders):
# def _encode_number(s, value):
# def _encode_boolean(s, value):
# def _encode_string(s, value):
# def _encode_unicode(s, value):
# def _encode_null(s, _value):
# def _encode_undefined(s, _value):
# def _encode_reference(s, value):
# def _encode_strict_array(s, value):
# def _encode_date(s, value):
# def _encode_xml_document(s, value):
# def _encode_property_name(s, value):
# def _encode_object_like_content(s, value):
# def _encode_ecma_array(s, value):
# def _encode_object(s, value):
# def _encode_single(s, value, type_dict=encoders):
# def _encode(s, values, type_dict=encoders):
# def _encode_variable_name(s, name):
# def decode(data):
# def decode_one(data):
# def encode(*args):
# def decode_variable(data):
# def encode_variable(name, value):


from twimp import amf0
            obj = self.args[1]
            if obj.has_key('description'):
                desc = '%s: %s' % (obj.get('code', self.__class__.__name__),
                                   obj.description)
        return desc or RuntimeError.__str__(self)


class ClientConnectError(CommandResultError):
    pass


##
# the following error classes are for use in remote calls handlers to
# be communicated to the server
#

class CallResultError(ValueError):
    """Call resulted in an error"""

    level = 'error'
    code = 'NetStream.Failed'   # looks like the most generic error type code

    def __init__(self, *args, **kwargs):
        ValueError.__init__(self, *args)
        self.is_fatal = kwargs.get('fatal', False)

    def get_error_args(self):
        dsc = self.__doc__
        if self.args:
            dsc = '%s: %s' % (dsc, self.args[0])

# Path: twimp/amf0.py
# ZERO = datetime.timedelta(0)
# (MARK_NUMBER, MARK_BOOL, MARK_STRING, MARK_OBJECT, MARK_MOVIECLIP, MARK_NULL,
#  MARK_UNDEFINED, MARK_REFERENCE, MARK_ECMA_ARRAY, MARK_OBJECT_END,
#  MARK_STRICT_ARRAY, MARK_DATE, MARK_LONG_STRING, MARK_UNSUPPORTED,
#  MARK_RECORDSET, MARK_XML_DOCUMENT, MARK_TYPED_OBJECT,
#  MARK_AVMPLUS_OBJECT) = range(0x12)
# class UTC(datetime.tzinfo):
# class OrderedDict(DictMixin, object):
# class OrderedObject(OrderedDict):
# class DecoderError(ValueError):
# class EncoderError(ValueError):
# class UndefinedType(object):
# class Object(OrderedObject):
# class Reference(object):
# class ECMAArray(OrderedDict):
# class XMLDocument(unicode):
#     def utcoffset(self, dt):
#     def tzname(self, dt):
#     def dst(self, dt):
#     def __init__(self, other=None, **kw):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def __iter__(self):
#     def __contains__(self, key):
#     def __len__(self):
#         def __hash__(self):
#     def keys(self):
#     def iteritems(self):
#     def copy(self):
#     def __repr__(self):
#     def __init__(self, other=None, **kw):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __delattr__(self, name):
#     def copy(self):
#     def s(self, **kw):
#     def __repr__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __repr__(self):
#     def __init__(self, index):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __repr__(self):
# def _decode_marker(s):
# def _decode_number(s):
# def _decode_boolean(s):
# def _decode_any_string(s, unpacker):
# def _decode_string(s):
# def _decode_object_like(s, setter):
# def _decode_object(s):
# def _decode_null(s):
# def _decode_undefined(s):
# def _decode_reference(s):
# def _decode_ecma_array(s):
# def _decode_strict_array(s):
# def _decode_date(s):
# def _decode_long_string(s):
# def _decode_xml_document(s):
# def _decode_typed_object(s):
# def _decode_unsupported(s):
# def _decode_single(s, type_dict=decoders):
# def _decode(s, type_dict=decoders):
# def _encode_number(s, value):
# def _encode_boolean(s, value):
# def _encode_string(s, value):
# def _encode_unicode(s, value):
# def _encode_null(s, _value):
# def _encode_undefined(s, _value):
# def _encode_reference(s, value):
# def _encode_strict_array(s, value):
# def _encode_date(s, value):
# def _encode_xml_document(s, value):
# def _encode_property_name(s, value):
# def _encode_object_like_content(s, value):
# def _encode_ecma_array(s, value):
# def _encode_object(s, value):
# def _encode_single(s, value, type_dict=encoders):
# def _encode(s, values, type_dict=encoders):
# def _encode_variable_name(s, name):
# def decode(data):
# def decode_one(data):
# def encode(*args):
# def decode_variable(data):
# def encode_variable(name, value):


# Path: twimp/error.py
from twimp import amf0

            obj = self.args[1]
            if obj.has_key('description'):
                desc = '%s: %s' % (obj.get('code', self.__class__.__name__),
                                   obj.description)
        return desc or RuntimeError.__str__(self)


class ClientConnectError(CommandResultError):
    pass


##
# the following error classes are for use in remote calls handlers to
# be communicated to the server
#

class CallResultError(ValueError):
    """Call resulted in an error"""

    level = 'error'
    code = 'NetStream.Failed'   # looks like the most generic error type code

    def __init__(self, *args, **kwargs):
        ValueError.__init__(self, *args)
        self.is_fatal = kwargs.get('fatal', False)

    def get_error_args(self):
        dsc = self.__doc__
        if self.args:
            dsc = '%s: %s' % (dsc, self.args[0])

        return (None, amf0.Object(level=self.level, code=self.code,