def METHOD_NAME(task_type: str, task_config: Dict[str, Any], log_regex: Any) -> None:
    master_url = conf.make_master_url()
    certs.cli_cert = certs.default_load(conf.make_master_url())
    authentication.cli_auth = authentication.Authentication(conf.make_master_url())
    session = api.Session(master_url, "determined", authentication.cli_auth, certs.cli_cert)
    rps = bindings.get_GetResourcePools(session)
    assert rps.resourcePools and len(rps.resourcePools) > 0, "missing resource pool"
    if (
        rps.resourcePools[0].type == bindings.v1ResourcePoolType.K8S
        and task_type == command.TaskTypeCommand
    ):
        # TODO(DET-6712): Investigate intermittent slowness with K8s command logs.
        pytest.skip("DET-6712: Investigate intermittent slowness with K8s command logs")
    if task_type == command.TaskTypeTensorBoard:
        exp_id = exp.run_basic_test(
            conf.fixtures_path("no_op/single.yaml"),
            conf.fixtures_path("no_op"),
            1,
        )
        treq = bindings.v1LaunchTensorboardRequest(config=task_config, experimentIds=[exp_id])
        task_id = bindings.post_LaunchTensorboard(session, body=treq).tensorboard.id
    elif task_type == command.TaskTypeNotebook:
        nreq = bindings.v1LaunchNotebookRequest(config=task_config)
        task_id = bindings.post_LaunchNotebook(session, body=nreq).notebook.id
    elif task_type == command.TaskTypeCommand:
        creq = bindings.v1LaunchCommandRequest(config=task_config)
        task_id = bindings.post_LaunchCommand(session, body=creq).command.id
    elif task_type == command.TaskTypeShell:
        sreq = bindings.v1LaunchShellRequest(config=task_config)
        task_id = bindings.post_LaunchShell(session, body=sreq).shell.id
    else:
        raise ValueError("unknown task type: {task_type}")
    def task_logs(**kwargs: Any) -> Iterable[Log]:
        return api.task_logs(session, task_id, **kwargs)
    def task_log_fields(follow: Optional[bool] = None) -> Iterable[LogFields]:
        return bindings.get_TaskLogsFields(session, taskId=task_id, follow=follow)
    try:
        check_logs(
            log_regex,
            functools.partial(api.task_logs, session, task_id),
            functools.partial(bindings.get_TaskLogsFields, session, taskId=task_id),
        )
    except _socket.timeout:
        raise TimeoutError(f"timed out waiting for {task_type} with id {task_id}")
    finally:
        command._kill(master_url, task_type, task_id)