docs: def get_template_object(template_file=''):
      """Retrieve template.
  
      Args:
          template_file (str): Name of template file.
  
      Returns:
          jinja2.Template: Template ready to render.
  
      Raises:
          AssertionError: Configured path for templates does not exist.
          :obj:`foremast.exceptions.ForemastTemplateNotFound`: Requested template
              is not available.
  
      """
      jinja_template_paths_obj = []
  
      if TEMPLATES_PATH:
          external_templates = pathlib.Path(TEMPLATES_PATH).expanduser().resolve()
          assert os.path.isdir(external_templates), 'External template path "{0}" not found'.format(external_templates)
          jinja_template_paths_obj.append(external_templates)
  
      jinja_template_paths_obj.append(LOCAL_TEMPLATES)
      jinja_template_paths = [str(path) for path in jinja_template_paths_obj]
  
      jinjaenv = jinja2.Environment(loader=jinja2.FileSystemLoader(jinja_template_paths))
  
      try:
          template = jinjaenv.get_template(template_file)
      except jinja2.TemplateNotFound:
          message = 'Unable to find template "{template_file}" in paths {paths}'.format(
              template_file=template_file, paths=jinjaenv.loader.searchpath)
          LOG.error(message)
          raise ForemastTemplateNotFound(message)
  
      return template