code: def test_beta_sync(wandb_init, runner, mark_synced):
      _ = pytest.importorskip("wandb_core")
  
      os.makedirs(".wandb", exist_ok=True)
      run = wandb_init(settings={"mode": "offline"})
      run.log(dict(a=1))
      run.finish()
  
      args = ["sync", ".wandb"]
      if not mark_synced:
          args.append("--no-mark-synced")
      result = runner.invoke(cli.beta, args)
      print(result.output)
      assert result.exit_code == 0
      assert f"{run.id}" in result.output
  
      if mark_synced:
          # check that f"{run.settings.sync_file}.synced" exists
          assert os.path.exists(f"{run.settings.sync_file}.synced")
      else:
          assert not os.path.exists(f"{run.settings.sync_file}.synced")
  
file_path: wandb/tests/pytest_tests/system_tests/test_core/test_offline_sync.py
imports: import os
  import unittest.mock
  import pytest
  import wandb
  from wandb.cli import cli
  from wandb.sdk.lib.runid import generate_id
label_desc: Use image node_id 2 for calling a global function with example usage: test_beta_sync(wandb_init, runner, mark_synced) without return types