code: def _write_logs(
      log_file_path: Path,
      log_events: List[RunnerLogEvent],
  ):
      log_events_parsed = [
          _runner_log_event_to_log_event(l) for l in log_events
      ]
      log_file_path.parent.mkdir(exist_ok=True, parents=True)
      with open(log_file_path, "a") as f:
          f.writelines(l.json() + "\n" for l in log_events_parsed)
  
file_path: dstack/src/dstack/_internal/server/services/logs.py
imports: import base64
  from datetime import datetime, timezone
  from pathlib import Path
  from typing import List
  from uuid import UUID
  from dstack._internal.core.models.logs import JobSubmissionLogs, LogEvent, LogEventSource
  from dstack._internal.server import settings
  from dstack._internal.server.models import ProjectModel
  from dstack._internal.server.schemas.logs import PollLogsRequest
  from dstack._internal.server.schemas.runner import LogEvent
label_desc: Use image node_id 2 for calling a global function with example usage: _write_logs(log_file_path, log_events) without return types