code: def test_trial_logs() -> None:
      # TODO: refactor tests to not use cli singleton auth.
      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,
      )
  
      experiment_id = exp.run_basic_test(
          conf.fixtures_path("no_op/single.yaml"),
          conf.fixtures_path("no_op"),
          1,
      )
      trial = exp.experiment_trials(experiment_id)[0].trial
      trial_id = trial.id
      task_id = trial.taskId
      assert task_id != ""
  
      log_regex = re.compile("^.*New trial runner.*$")
  
      # Trial-specific APIs should work just fine.
      check_logs(
          log_regex,
          functools.partial(api.trial_logs, session, trial_id),
          functools.partial(
              bindings.get_TrialLogsFields, session, trialId=trial_id
          ),
      )
  
      # And so should new task log APIs.
      check_logs(
          log_regex,
          functools.partial(api.task_logs, session, task_id),
          functools.partial(
              bindings.get_TaskLogsFields, session, taskId=task_id
          ),
      )
  
file_path: determined/e2e_tests/tests/cluster/test_logging.py
imports: import functools
  import re
  import sys
  import threading
  from typing import Any, Callable, Dict, Iterable, Optional, Union
  import pytest
  from determined.common import api
  from determined.common.api import authentication, bindings, certs
  from tests import config
  from tests import experiment
label_desc: Use image node_id 1 for calling a global function with example usage: test_trial_logs() without return types