code: def mock_det_auth(
      user: str = "test", master_url: str = "http://localhost:8888"
  ) -> Authentication:
      with mock.Mocker() as mocker:
          mocker.get(
              master_url + "/api/v1/me",
              status_code=200,
              json={"username": user},
          )
          fake_user = {"username": user, "admin": True, "active": True}
          mocker.post(
              master_url + "/api/v1/auth/login",
              status_code=200,
              json={"token": "fake-token", "user": fake_user},
          )
          mocker.get("/info", status_code=200, json={"version": "1.0"})
          mocker.get(
              "/users/me",
              status_code=200,
              json={"username": constants.DEFAULT_DETERMINED_USER},
          )
          auth = Authentication(
              master_address=master_url,
              requested_user=user,
              password="password1",
              cert=certs.Cert(noverify=True),
          )
          return auth
  
file_path: determined/harness/tests/cli/test_experiment.py
imports: import dataclasses
  import unittest.mock
  import pytest
  import requests_mock
  import determined
  import determined.cli
  from determined.common import constants
  from determined.common.api import bindings, certs
  from determined.common.api.authentication import Authentication
  from tests.fixtures import api_responses
label_desc: Use image node_id 1 for calling a global function with example usage: mock_det_auth(user, master_url) and returns: auth