def copy(src, dst):
(szip, dzip) = (src.endswith("<STR_LIT>"), dst.endswith("<STR_LIT>"))<EOL>logging.info("<STR_LIT>"%(src, dst))<EOL>if szip and dzip:<EOL><INDENT>shutil.copy2(src, dst)<EOL><DEDENT>elif szip:<EOL><INDENT>with zipfile.ZipFile(src, mode='<STR_LIT:r>') as z:<EOL><INDENT>tmpdir = tempfile.mkdtemp()<EOL>try:<EOL><INDENT>z.extractall(tmpdir)<EOL>if len(z.namelist()) != <NUM_LIT:1>:<EOL><INDENT>raise RuntimeError("<STR_LIT>""<STR_LIT>"%src)<EOL><DEDENT>tmpfile = join(tmpdir,z.namelist()[<NUM_LIT:0>])<EOL>try:<EOL><INDENT>os.remove(dst)<EOL><DEDENT>except OSError:<EOL><INDENT>pass<EOL><DEDENT>shutil.move(tmpfile, dst)<EOL><DEDENT>finally:<EOL><INDENT>shutil.rmtree(tmpdir, ignore_errors=True)<EOL><DEDENT><DEDENT><DEDENT>elif dzip:<EOL><INDENT>with zipfile.ZipFile(dst, mode='<STR_LIT:w>', compression=ZIP_DEFLATED) as z:<EOL><INDENT>z.write(src, arcname=basename(src))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>shutil.copy2(src, dst)<EOL><DEDENT>
File copy that support compress and decompress of zip files