code: def list_template(args: Namespace) -> None:
      templates: List[TemplateAll] = []
      w_names = cli.workspace.get_workspace_names(
          cli.setup_session(args)
      )
  
      for tpl in bindings.get_GetTemplates(
          cli.setup_session(args)
      ).templates:
          w_name = w_names.get(tpl.workspaceId, "missing workspace")
          templates.append(
              TemplateAll(tpl.name, w_name, _parse_config(tpl.config))
          )
      if args.details:
          render.render_objects(
              TemplateAll, templates, table_fmt="grid"
          )
      else:
          render.render_objects(TemplateClean, templates)
  
file_path: determined/harness/determined/cli/template.py
imports: from argparse import ArgumentError, FileType, Namespace
  from collections import namedtuple
  from typing import Any, Dict, List
  from termcolor import colored
  from determined import cli
  from determined.cli import render
  from determined.cli.workspace import get_workspace_id_from_args, workspace_arg
  from determined.common import api, util
  from determined.common.api import authentication, bindings
  from determined.common.declarative_argparse import Arg, Cmd
label_desc: Use image node_id 2 for calling a global function with example usage: list_template(args) without return types