def deserialize(A, response, response_type):
    """Deserializes response into an object.

        :param response: RESTResponse object to be deserialized.
        :param response_type: class literal for
            deserialized object, or string of class name.

        :return: deserialized object.
        """
    C = response_type
    B = response
    if C == 'file':
        return A.__deserialize_file(B)
    D = B.data
    return A.__deserialize(D, C)
