code: def setup_session(args: argparse.Namespace) -> api.Session:
      master_url = args.master or util.get_default_master_address()
      cert = certs.default_load(master_url)
      retry = api.default_retry()
  
      return api.Session(
          master_url, args.user, authentication.cli_auth, cert, retry
      )
  
file_path: determined/harness/determined/cli/_util.py
imports: import argparse
  import functools
  import sys
  from typing import Any, Callable, Dict, List, Sequence
  import termcolor
  from determined.cli import errors, render
  from determined.common import api, declarative_argparse, util
  from determined.common.api import authentication, bindings, certs
  from determined.experimental import client
label_desc: Use image node_id 3 for calling a global function with example usage: setup_session(args) and returns: api