import zlib


def decompress_data(data, size):
    """Decompress data compressed with `compress_data`.

    If the size of the data is the same as *size* the data is assumed to be
    uncompressed and is returned directly.

    Args:
        data: The data to be decompressed.
        size: The original size of the data.

    Returns:
        The decompressed data.
    """
    if size == len(data):
        return data
    else:
        return zlib.decompress(data)