code: def setup_from_manifest_template(
      host_type: str,
      deployment_type: str,
      template_location: Optional[str] = None,
      overwrite: bool = False,
      verbose: bool = False,
  ) -> Dict:
      template, template_hash = get_template_yml(template_location)
  
      kwargs_to_parse = {}
  
      if template is None:
          raise ValueError(
              f"Failed to read {template_location}. Please check the file name or path is correct."
          )
  
      git_hash = template["hash"]
      git_base_url = template["baseUrl"]
      target_dir = manifest_cache_path(template_hash)
      all_template_files = template["files"]
      docker_tag = template["dockerTag"]
      files_to_download = []
  
      for package_name in all_template_files:
          # Get all files w.r.t that package e.g. grid, syft, hagrid
          template_files = all_template_files[package_name]
          package_path = template_files["path"]
  
          # common files
          files_to_download += [
              os.path.join(package_path, f)
              for f in template_files["common"]
          ]
  
          # docker related files
          if host_type in ["docker"]:
              files_to_download += [
                  os.path.join(package_path, f)
                  for f in template_files["docker"]
              ]
  
          # add k8s related files
          # elif host_type in ["k8s"]:
          #     files_to_download += template_files["k8s"]
  
          else:
              raise Exception(
                  f"Hagrid template does not currently support {host_type}."
              )
  
      if EDITABLE_MODE and is_path(template_location):
          # to test things in editable mode we can pass in a .yml file path and it will
          # copy the files instead of download them
          for src_file_path in track(
              files_to_download, description="Copying files"
          ):
              full_src_dir = f"{repo_src_path()}/{src_file_path}"
              full_target_path = f"{target_dir}/{src_file_path}"
              full_target_dir = os.path.dirname(full_target_path)
              os.makedirs(full_target_dir, exist_ok=True)
  
              shutil.copyfile(
                  full_src_dir,
                  full_target_path,
              )
      else:
          download_files(
              files_to_download=files_to_download,
              git_hash=git_hash,
              git_base_url=git_base_url,
              target_dir=target_dir,
              overwrite=overwrite,
              verbose=verbose,
          )
  
      kwargs_to_parse["tag"] = docker_tag
      return kwargs_to_parse
  
imports: import hashlib
  import os
  import shutil
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Tuple
  from typing import Union
  from urllib.parse import urlparse
  from jinja2 import Environment
  from jinja2 import FileSystemLoader
  from jinja2 import Template
  import requests
  from rich.progress import track
  import yaml
  from .cache import DEFAULT_REPO
  from .cache import STABLE_BRANCH
  from .lib import hagrid_cache_dir
  from .lib import manifest_template_path
  from .lib import repo_src_path
  from .mode import EDITABLE_MODE
label_desc: Use image node_id 10 for calling a global function with example usage: setup_from_manifest_template(host_type, deployment_type, template_location, overwrite, verbose) and returns: kwargs_to_parse