// handle login related parameters as these are applied to global state
anonymous = kwargs.pop("anonymous", None)
force = kwargs.pop("force", None)
login_key = wandb.login(anonymous=anonymous, force=force)
// apply updated global state after login was handled
settings._apply_settings(wandb.setup()._settings)
// this must happen after applying global state which overrides mode
if not login_key:
settings.mode = "offline"
settings._apply_init(kwargs)
// TODO(jhr): should this be moved? probably.
d = dict(_start_time=time.time(), _start_datetime=datetime.datetime.now(),)