code: def setup_template_test(
      session: Optional[Session] = None,
      workspace_id: Optional[int] = None,
      name: str = "template",
  ) -> Tuple[Session, bindings.v1Template]:
      session = (
          api_utils.determined_test_session()
          if session is None
          else session
      )
      tpl = bindings.v1Template(
          name=api_utils.get_random_string(),
          config=conf.load_config(
              conf.fixtures_path(f"templates/{name}.yaml")
          ),
          workspaceId=workspace_id if workspace_id is not None else 1,
      )
  
      # create
      resp = bindings.post_PostTemplate(
          session, body=tpl, template_name=tpl.name
      )
      assert_templates_equal(tpl, resp.template)
      return (session, tpl)
  
imports: from typing import Optional, Tuple
  import pytest
  from determined.common import util
  from determined.common.api import NTSC_Kind, Session, bindings, errors
  from tests import api_utils
  from tests import command
  from tests import config
  from tests import experiment
  from tests import template
  from tests.cluster import test_rbac
  from tests.cluster import test_users
label_desc: Use image node_id 6 for calling a global function with example usage: setup_template_test(session, workspace_id, name) and returns: session,  tpl