def copy_skeleton_dir(destination):
    """
    Copy the skeleton directory (spyder_template) to a new directory.
    """
    if not os.path.exists(destination):
        os.makedirs(destination)
    template_dir = os.path.join(__path__[0], 'spyder_template')
    wanted_files = [".keep", "logging.conf"]

    for root, subdirs, files in os.walk(template_dir):
        relative = root[len(template_dir) + 1:]
        if relative:
            os.mkdir(os.path.join(destination, relative))

        for subdir in subdirs:
            if subdir.startswith('.'):
                subdirs.remove(subdir)

        for filename in files:
            if (not filename.endswith('.py') and \
                wanted_files not in filename) or \
                filename == "__init__.py":

                continue

            path_old = os.path.join(root, filename)
            path_new = os.path.join(destination, relative, filename)
            fp_old = open(path_old, 'r')
            fp_new = open(path_new, 'w')
            fp_new.write(fp_old.read())
            fp_old.close()
            fp_new.close()

            try:
                shutil.copymode(path_old, path_new)
                if sys.platform.startswith('java'):
                    # On Jython there is no os.access()
                    return
                if not os.access(path_new, os.W_OK):
                    st_new = os.stat(path_new)
                    new_perm = stat.S_IMODE(st_new.st_mode) | stat.S_IWUSR
                    os.chmod(path_new, new_perm)
            except OSError:
                sys.stderr.write("Could not set permission bits on %s" %
                    path_new)
dataset/ETHPy150Open retresco/Spyder/src/spyder/__init__.py/copy_skeleton_dir/swapped operands of `not in`