def changeAllProjectVersions(root, prerelease, patch, today=None):
    if not today:
        today = date.today()
    formattedToday = today.strftime('%Y-%m-%d')

    twistedProject = Project(root.child("twisted"))
    oldVersion = twistedProject.getVersion()
    newVersion = getNextVersion(oldVersion, prerelease, patch, today)

    def _makeNews(project, underTopfiles=True):
        builder = NewsBuilder()
        builder._changeNewsVersion(
            root.child("NEWS"), builder._getNewsName(project),
            oldVersion, newVersion, formattedToday)
        if underTopfiles:
            builder._changeNewsVersion(
                project.directory.child("topfiles").child("NEWS"),
                builder._getNewsName(project), oldVersion, newVersion,
                formattedToday)

    if oldVersion.prerelease:
        _makeNews(twistedProject, underTopfiles=False)

    for project in findTwistedProjects(root):
        if oldVersion.prerelease:
            _makeNews(project)
        project.updateREADME(newVersion)

    # Then change the global version.
    twistedProject.updateVersion(newVersion)
    _changeVersionInFile(oldVersion, newVersion, root.child('README.rst').path)
Movie neighbor based classifier
dataset/ETHPy150Open twisted/twisted/twisted/python/_release.py/changeAllProjectVersions--crossover with--dataset/ETHPy150Open luispedro/BuildingMachineLearningSystemsWithPython/ch08/similar_movie.py/nn_movie