def get_partition_key(partition_type, partition_num=None):
    """Generates a unique key for a partition using its attributes"""
    key = 'partition'
    if partition_type in ['cv', 'test']:
        return '_'.join([key, partition_type])
    elif partition_type == 'train':
        assert partition_num is not None
        return '_'.join([key, partition_type, str(partition_num)])
    else:
        raise Exception('Invalid partition type {}'.format(partition_type))