code: def test_login_key_arg(runner, dummy_api_key):
      with runner.isolated_filesystem():
          # If the test was run from a directory containing .wandb, then __stage_dir__
          # was '.wandb' when imported by api.py, reload to fix. UGH!
          # reload(wandb)
          result = runner.invoke(cli.login, [dummy_api_key])
          print("Output: ", result.output)
          print("Exception: ", result.exception)
          print("Traceback: ", traceback.print_tb(result.exc_info[2]))
          assert result.exit_code == 0
          with open(get_netrc_file_path()) as f:
              generated_netrc = f.read()
          assert dummy_api_key in generated_netrc
  
imports: import datetime
  import getpass
  import importlib
  import netrc
  import os
  import subprocess
  import traceback
  from unittest import mock
  import pytest
  import wandb
  from wandb.apis.internal import InternalApi
  from wandb.cli import cli
  from wandb.sdk.lib.apikey import get_netrc_file_path
label_desc: Use image node_id 6 for calling a global function with example usage: test_login_key_arg(runner, dummy_api_key) without return types