code: def _sync_once(state):
      log = state.log
      log.info("Sync started")
      cmd = [
          "aws",
          "s3",
          "sync",
          "--delete",
          "--size-only",
          "--no-progress",
          state.runs_dir,
          state.s3_uri + "/runs/",
      ]
      p = subprocess.Popen(
          cmd,
          stdout=subprocess.PIPE,
          stderr=subprocess.STDOUT,
      )
      while True:
          line = p.stdout.readline()
          if not line:
              break
          log.info(line[:-1].decode())
      log.info("Sync stopped")
  
file_path: guildai/guild/commands/s3_sync_impl.py
imports: import subprocess
  import re
  import time
  from guild import cli
  from guild import util
  from guild import var
  from .None import service_impl_support
label_desc: Use image node_id 5 for calling a global function with example usage: _sync_once(state) without return types