code: def write_logs(
      project: ProjectModel,
      run_name: str,
      job_submission_id: UUID,
      runner_logs: List[RunnerLogEvent],
      job_logs: List[RunnerLogEvent],
  ):
      if len(runner_logs) > 0:
          runner_log_file_path = _get_runner_log_file_path(
              project_name=project.name,
              run_name=run_name,
              job_submission_id=job_submission_id,
          )
          _write_logs(
              log_file_path=runner_log_file_path,
              log_events=runner_logs,
          )
      if len(job_logs) > 0:
          job_log_file_path = _get_job_log_file_path(
              project_name=project.name,
              run_name=run_name,
              job_submission_id=job_submission_id,
          )
          _write_logs(
              log_file_path=job_log_file_path,
              log_events=job_logs,
          )
  
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 1 for calling a global function with example usage: write_logs(project, run_name, job_submission_id, runner_logs, job_logs) without return types