def __deserialize_model(self, data, klass):
        """
        Deserializes list or dict to model.

        :param data: dict, list.
        :param klass: class literal.
        :return: model object.
        """
        if not klass.swagger_types:
            return data

        kwargs = {}
        for attr, attr_type in iteritems(klass.swagger_types):
            if data is not None \
               and klass.attribute_map[attr] in data \
               and isinstance(data, (list, dict)):
                value = data[klass.attribute_map[attr]]
                kwargs[attr] = self.__deserialize(value, attr_type)

        instance = klass(**kwargs)     

        return instance
Deserializes list or dict to model.

        :param data: dict, list.
        :param klass: class literal.
        :return: model object.