def METHOD_NAME(
    wheel_path,
    *,
    name,
    version,
    tag,
    metadata,
    description,
    contents,
    entrypoints: list[str] | None = None,
    top_level: list[str] | None = None,
):
    dist_info = f"{name}-{version}.dist-info"
    extra = {}
    if entrypoints:
        entrypoints_joined = "\n".join(entrypoints)
        text = f"[console_scripts]\n{entrypoints_joined}"
        file = f"{dist_info}/entry_points.txt"
        extra[file] = text.encode("utf8")
    if top_level:
        top_level_joined = "\n".join(top_level) + "\n"
        file = f"{dist_info}/top_level.txt"
        extra[file] = top_level_joined.encode("utf8")
    return write_wheel_file(
        wheel_path,
        {
            **contents,
            **extra,
            f"{dist_info}/METADATA": make_message(
                {
                    "Metadata-Version": "2.1",
                    "Name": name,
                    "Version": version,
                    **metadata,
                },
                description,
            ),
            f"{dist_info}/WHEEL": make_message(
                {
                    "Wheel-Version": "1.0",
                    "Generator": "anki write_wheel.py",
                    "Root-Is-Purelib": "false",
                    "Tag": tag,
                }
            ),
        },
    )