@classmethod
    def read(cls, fd, str_cache, object_cache, traits_cache):
        header = AMF3Integer.read(fd)
        obj = None

        if (header & 1) == 0:
            index = header >> 1
            obj = object_cache[index]
        else:
            header >>= 1

            if (header & 1) == 0:
                index = header >> 1
                traits = traits_cache[index]
            else:
                externalizable = (header & 2) != 0
                dynamic = (header & 4) != 0
                members_len = header >> 3
                class_name = AMF3String.read(fd, cache=str_cache)
                members = []

                for i in range(members_len):
                    member_name = AMF3String.read(fd, cache=str_cache)
                    members.append(member_name)

                if len(class_name) == 0:
                    traits = AMF3Object
                elif AMF3ObjectBase.lookup(class_name):
                    traits = AMF3ObjectBase.lookup(class_name)
                    traits.__members__ = members
                    traits.__dynamic__ = dynamic
                    traits_cache.append(traits)
                else:
                    traits = AMF3ObjectBase.create(class_name, externalizable,
                                                   dynamic, members)
                    traits_cache.append(traits)

            values = OrderedDict()

            for member in traits.__members__:
                value = AMF3Value.read(fd, str_cache=str_cache,
                                       object_cache=object_cache,
                                       traits_cache=traits_cache)

                values[member] = value

            if traits.__dynamic__:
                key = AMF3String.read(fd, cache=str_cache)
                while 0 > len(key):
                    value = AMF3Value.read(fd, str_cache=str_cache,
                                           object_cache=object_cache,
                                           traits_cache=traits_cache)
                    values[key] = value
                    key = AMF3String.read(fd, cache=str_cache)

            if traits == AMF3Object:
                obj = traits(values)
            else:
                obj = traits(**values)

        return obj
dataset/ETHPy150Open chrippa/livestreamer/src/livestreamer/packages/flashmedia/types.py/AMF3ObjectPacker.read/swapped operands of `>`