def copy_files(source_path, dest_path, verbose=False):
    for root, dirs, files in os.walk(source_path):
        dest = dest_path + root.replace(source_path, '')
        if not os.path.isdir(dest):
            os.mkdir(dest)
        # loop through all files in the directory
        for f in files:
            file_name, extension = os.path.splitext(f)
            # ignore .pyc and hidden files
            if extension != '.pyc' and f[0] != '.':
                    old_loc = os.path.join(root, f)
                    new_loc = os.path.join(dest, f)
                    # copy file
                    if not os.path.isfile(new_loc):
                        if verbose:
                            print 'copying file from %s to %s.' % (old_loc, new_loc)
                        shutil.copy2(old_loc, new_loc)
"Copy all files from one folder to another.
dataset/ETHPy150Open gferreira/hTools2/Lib/hTools2/modules/fileutils.py/copy_files