def dump_dataset(filename, data):
    fid = open(filename, 'w')
    try:
        for line in data:
            fid.write(f'''{' '.join(line)}
''')
    finally:
        fid.close()
def dump_dataset(filename, data):
    fid = open(filename, 'w')
    try:
        for line in data:
            fid.write(f'{' '.join(line)}
')
    finally:
        fid.close()