def copy_rec(source, dest):
if os.path.isdir(source):<EOL><INDENT>for child in os.listdir(source):<EOL><INDENT>new_dest = os.path.join(dest, child)<EOL>os.makedirs(new_dest, exist_ok=True)<EOL>copy_rec(os.path.join(source, child), new_dest)<EOL><DEDENT><DEDENT>elif os.path.isfile(source):<EOL><INDENT>logging.info('<STR_LIT>'.format(source, dest))<EOL>shutil.copy(source, dest)<EOL><DEDENT>else:<EOL><INDENT>logging.info('<STR_LIT>'.format(source))<EOL><DEDENT>
Copy files between diferent directories.

    Copy one or more files to an existing directory. This function is
    recursive, if the source is a directory, all its subdirectories are created
    in the destination. Existing files in destination are overwrited without
    any warning.

    Args:
        source (str): File or directory name.
        dest (str): Directory name.

    Raises:
        FileNotFoundError: Destination directory doesn't exist.