def calculate_size(transformed_dataset):
    """Helper function to calculate the total size of a dataset

    Args:
        transformed_dataset (dict): a ``TransformedDataset`` instance, which maps (str) table name
            to {'size': (float) size of the table in byte, 'row_size': (float) the size of a
            row in byte, 'entries': (set) the column names, 'chosen': (set) the rows selected}

    Returns:
        float: the dataset size in byte
    """
    size = 0
    for table in transformed_dataset.values():
        size += table['row_size'] * len(table['chosen'])
    return size