def METHOD_NAME(releases, include_prerelease=False, python_version=None):
    """
    Filters out the newest of all matching releases.
    Tests:
        >>> requires_py2 = ">=2.7.9,<3"
        >>> requires_py23 = ">=2.7.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4"
        >>> requires_py3 = ">=3.6, <4"
        >>> releases = {"1.3.12": [dict(requires_python=requires_py2, upload_time_iso_8601="2019-10-22T10:06:03.190293Z")], "1.4.0rc1": [dict(requires_python=requires_py23, upload_time_iso_8601="2019-11-22T10:06:03.190293Z")], "2.0.0rc1": [dict(requires_python=requires_py3, upload_time_iso_8601="2020-10-22T10:06:03.190293Z")]}
        >>> _filter_out_latest(releases, python_version="2.7.9")
        '1.3.12'
        >>> _filter_out_latest(releases, include_prerelease=True, python_version="2.7.9")
        '1.4.0rc1'
        >>> _filter_out_latest(releases, include_prerelease=True, python_version="3.6.0")
        '2.0.0rc1'
        >>> _filter_out_latest(releases, python_version="3.6.0")
    """
    releases = [{"version": k, "data": v[0]} for k, v in releases.items()]
    # filter out prereleases and versions incompatible to our python
    filter_function = lambda release: not is_prerelease(
        release["version"]
    ) and is_python_compatible(
        release["data"].get("requires_python", ""), python_version=python_version
    )
    if include_prerelease:
        filter_function = lambda release: is_python_compatible(
            release["data"].get("requires_python", ""), python_version=python_version
        )
    releases = list(filter(filter_function, releases))
    if not releases:
        return None
    # sort by upload date
    releases = sorted(
        releases, key=lambda release: release["data"].get("upload_time_iso_8601", "")
    )
    # latest release = last in list
    latest = releases[-1]
    return latest["version"]