def recursive_overwrite(src, dest, ignore=None):
if os.path.islink(src):<EOL><INDENT>linkto = os.readlink(src)<EOL>if os.path.exists(dest):<EOL><INDENT>os.remove(dest)<EOL><DEDENT>symlink(linkto, dest)<EOL><DEDENT>elif os.path.isdir(src):<EOL><INDENT>if not os.path.isdir(dest):<EOL><INDENT>os.makedirs(dest)<EOL><DEDENT>files = os.listdir(src)<EOL>if ignore is not None:<EOL><INDENT>ignored = ignore(src, files)<EOL><DEDENT>else:<EOL><INDENT>ignored = set()<EOL><DEDENT>for _ in files:<EOL><INDENT>if _ not in ignored:<EOL><INDENT>recursive_overwrite(os.path.join(src, _),<EOL>os.path.join(dest, _),<EOL>ignore)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>shutil.copyfile(src, dest)<EOL><DEDENT>
Banana banana