code: def launch_command(
      master: str,
      endpoint: str,
      config: Dict[str, Any],
      template: str,
      context_path: Optional[Path] = None,
      includes: Iterable[Path] = (),
      data: Optional[Dict[str, Any]] = None,
      workspace_id: Optional[int] = None,
      preview: Optional[bool] = False,
      default_body: Optional[Dict[str, Any]] = None,
  ) -> Any:
      user_files = context.read_legacy_context(context_path, includes)
  
      body = {}  # type: Dict[str, Any]
      if default_body:
          body.update(default_body)
  
      body["config"] = config
  
      if template:
          body["template_name"] = template
  
      if len(user_files) > 0:
          body["files"] = user_files
  
      if data is not None:
          message_bytes = json.dumps(data).encode("utf-8")
          base64_bytes = base64.b64encode(message_bytes)
          body["data"] = base64_bytes
  
      if preview:
          body["preview"] = preview
  
      if workspace_id is not None:
          body["workspaceId"] = workspace_id
  
      return api.post(
          master,
          endpoint,
          body,
      ).json()
  
imports: import base64
  import json
  import operator
  import re
  from argparse import Namespace
  from collections import OrderedDict
  from functools import reduce
  from pathlib import Path
  from typing import IO, Any, Dict, Iterable, List, Optional, Tuple, Union
  from termcolor import colored
  import determined.cli.render
  from determined import cli
  from determined.cli import render
  from determined.common import api, context, declarative_argparse, util
  from determined.common.api import authentication
  from determined.util import merge_dicts
label_desc: Use image node_id 11 for calling a global function with example usage: launch_command(master, endpoint, config, template, context_path, includes, data, workspace_id, preview, default_body) and returns: api