def cleanup_toml(tml):
    toml = tml.split('\n')
    new_toml = []
    for line in toml:
        if line.strip():
            new_toml.append(line)
    toml = '\n'.join(new_toml)
    new_toml = []
    for (i, line) in enumerate(toml.split('\n')):
        if line.startswith('['):
            if (i > 0):
                new_toml.append('')
        new_toml.append(line)
    new_toml.append('')
    toml = '\n'.join(new_toml)
    return toml
def cleanup_toml(tml):
    toml = tml.split('\n')
    new_toml = []
    for line in toml:
        if line.strip():
            new_toml.append(line)
    toml = '\n'.join(new_toml)
    new_toml = []
    for (i, line) in enumerate(toml.split('\n')):
        if line.startswith('['):
            if (i > 0):
                new_toml.append()
        new_toml.append(line)
    new_toml.append()
    toml = '\n'.join(new_toml)
    return toml