code: def test_init_add_login(runner, empty_netrc, user):
      with runner.isolated_filesystem(), mock.patch(
          "wandb.sdk.lib.apikey.len", return_value=40
      ):
          with open("netrc", "w") as f:
              f.write("previous config")
          result = runner.invoke(cli.login, [user])
          debug_result(result, "login")
          result = runner.invoke(
              cli.init, input=f"y\n{user}\nvanpelt\n"
          )
          debug_result(result, "init")
          assert result.exit_code == 0
          with open("netrc") as f:
              generated_netrc = f.read()
          with open("wandb/settings") as f:
              generated_wandb = f.read()
          assert user in generated_netrc
          assert user in generated_wandb
  
file_path: wandb/tests/pytest_tests/system_tests/test_core/test_cli_full.py
imports: import netrc
  import os
  import traceback
  from unittest import mock
  import pytest
  import wandb
  from wandb.cli import cli
label_desc: Use image node_id 4 for calling a global function with example usage: test_init_add_login(runner, empty_netrc, user) without return types