def METHOD_NAME(
    context, release, service_list, machine_name
):
    service_list = service_list.split(",")
    apt_mirror_file = """
    set nthreads     20
    set _tilde 0
    """
    for service in service_list:
        token = context.service_mirror_cfg[service.replace("-", "_")][
            "credentials"
        ]
        service_type = service.split("-")[1]
        apt_mirror_cfg = """
        deb https://bearer:{}@esm.ubuntu.com/{}/ubuntu/ jammy-{}-updates main
        deb https://bearer:{}@esm.ubuntu.com/{}/ubuntu/ jammy-{}-security main
        """.format(
            token,
            service_type,
            service_type,
            token,
            service_type,
            service_type,
        )
        apt_mirror_file += "\n" + apt_mirror_cfg + "\n"
    apt_mirror_file += "clean http://archive.ubuntu.com/ubuntu"
    context.text = apt_mirror_file.strip()
    when_i_create_file_with_content(
        context,
        "/etc/apt/mirror.list",
        machine_name=machine_name,
    )