def dump_add_vspacing(buff, vspacing):
    """Post-processing to add some nice-ish spacing for deeper map/list levels."""
    if isinstance(vspacing, int):
        vspacing = ['\n'] * (vspacing + 1)
    buff.seek(0)
    result = list()
    for line in buff:
        level = 0
        line = line.decode('utf-8')
        result.append(line)
        if ':' in line:
            while line.startswith('  '):
                level, line = level + 1, line[2:]
            if len(vspacing) > level and len(result) != 1:
                vspace = vspacing[level]
                vspace = vspace if not isinstance(vspace, int
                    ) else '\n' * vspace
                result.insert(-1, vspace)
    buff.seek(0), buff.truncate()
    buff.write(''.join(result).encode('utf-8'))
