templateIdで指定されたテンプレートを返却する。
@param {String} templateId
@return {promise|*|Q.promise}
550425
function( templateId ){
        var deferred = Q.defer();

        if( this.templates[ templateId ] ){
            deferred.resolve( this.templates[ templateId ] );
        }
        else {
            this.registerTemplate( templateId ).done( function( template ){
                deferred.resolve( template );
            } );
        }

        return deferred.promise;
    }
1178302
public Template getAjaxTemplate(String key, String ajaxId, ResourceLoader loader)
	{
		Template template = this.getTemplateByLoader(key, loader,true);
		template.ajaxId = ajaxId;
		return template;
	}
841672
function (template) {
          if (fetchPromises[template]) {
            return fetchPromises[template];
          }

          fetchPromises[template] = $http.get(template, {
            cache: $templateCache
          });

          return fetchPromises[template].then(function (response) {
            return response.data;
          });
        }
1052770
async function getTemplate({template, preset}) {
	if (typeof template === 'string') {
		return template;
	}

	if (typeof preset === 'string') {
		try {
			return (
				await read(
					resolve(
						__dirname,
						'templates',
						[preset.toLowerCase(), 'html'].join('.'),
					)
				)
			).toString();
		} catch (error) {
			throw new Error(`Preset ${preset} not found`);
		}
	}

	return DEFAULT_TEMPLATE;
}
99881
protected function getAvailableTemplateFromTypoScriptConfiguration($pageId, $templateKey)
    {
        $configuration = $this->getConfigurationFromPageId($pageId);
        return $configuration->getAvailableTemplatesByFileKey($templateKey);
    }
652965
def viewTemplate(id):
        
        conn = Qubole.agent()
        return conn.get(Template.element_path(id))
692631
async function render(nj, templ, templateVars) {
  debug('templ before: ', templ);
  // if no vars passed, use
  // template itself as source of variables:
  if (_.isUndefined(templateVars))
    templateVars = JSON.parse(_.cloneDeep(templ));

  templ = await nj.renderStringAsync(templ, templateVars);
  if (templ.match(/\{\{.*\}\}/)) {
    // recurse
    return await render(nj, templ, templateVars);
  }
  return templ;
}
1088799
public function getTemplate( $templateId ){
        $path = sprintf( self::PATH_TEMPLATE_LOOKUP, $templateId );

        return $this->httpGet( $path );

    }
1079128
public static <T> Middleware<AsyncHandler<T>, AsyncHandler<Response<ByteString>>> htmlSerialize(
      final String templateName) {
    return handler ->
        requestContext -> handler.invoke(requestContext)
            .thenApply(result -> Response
                .forPayload(serialize(templateName, result))
                .withHeader(CONTENT_TYPE, HTML));
  }
247982
public function getDeliverTemplate($templateId)
    {
        $result = $this->httpRaw(self::WECHAT_SHOP_DELIVERY_TEMPLATE_ID_GET_URL .
            'access_token=' . $this->getAccessToken(), [
                'template_id' => $templateId
            ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['template_info'] : false;
    }
635828
public static TaskTemplate getTaskTemplate(String logicalId) {
        for (int i = 0; i < taskVoCache.size(); i++) {
            TaskTemplate task = taskVoCache.get(i);
            if (logicalId.equals(task.getLogicalId())) {
               return task;
            }
        }
        return null;
    }
621571
function(template, templateUrl) {
          var deferred = $q.defer();

          if (template) {
            deferred.resolve(template);

          } else if (templateUrl) {
            //  Check to see if the template has already been loaded.
            var cachedTemplate = $templateCache.get(templateUrl);

            if (cachedTemplate) {
              deferred.resolve(cachedTemplate);

            } else {
              //  If not, let's grab the template for the first time.
              $http.get(templateUrl).then(function(result) {

                //  Save template into the cache and return the template.
                $templateCache.put(templateUrl, result.data);

                deferred.resolve(result.data);

              }, function(error) {
                deferred.reject(error);
              });
            }

          } else {
            deferred.reject('No template or templateUrl has been specified.');
          }

          return deferred.promise;
        }
85584
public function getTemplate($target, $themeId, $templateId){
        $theme = $this->getTheme($target, $themeId);
        if(isset($theme['templates']) && isset($theme['templates'][$templateId])){
            return $this->resolveTemplatePath($theme['templates'][$templateId]);
        }
        return null;
    }
539275
function (templateFiles, dataFiles) {
  return templateFiles.reduce(function (templatesMap, template) {
    let templateName = path.parse(template).name;
    // Get data file with the same base name as the template file
    let dataFile = dataFiles.find(function (file) {
      return path.parse(file).name === templateName;
    });

    templatesMap[templateName] = promiseAllProps({
      'template': readFile(template, 'utf8'),
      'data': readFile(dataFile, 'utf8')
        // Use passed data fall back to an empty object
        .then(function (data) {
          return JSON.parse(data);
        })
        .catch(function () {
          return {};
        })
    });

    return templatesMap;
  }, {});
}
951066
function loadTemplates() {
  const templatesPath = path.join(process.cwd(), plugin.config.templatesPath);

  return plugin.myrmex.fire('beforeTemplatesLoad')
  .then(() => {
    // Retrieve paths of all node packages
    return Promise.promisify(fs.readdir)(templatesPath);
  })
  .then(files => {
    // Load all packages configurations
    const templatePromises = [];
    _.forEach(files, (fileName) => {
      const templatePath = path.join(templatesPath, fileName);
      // subdir is the identifier of the template, so we pass it as the second argument
      templatePromises.push(loadTemplate(templatePath, fileName));
    });
    return Promise.all(templatePromises);
  })
  .then(templates => {
    // This event allows to inject code to add or delete or alter node templates configurations
    return plugin.myrmex.fire('afterTemplatesLoad', templates);
  })
  .spread(templates => {
    return Promise.resolve(templates);
  })
  .catch(e => {
    // In case the project does not have any template yet, an exception will be thrown
    // We silently ignore it
    if (e.code === 'ENOENT' && path.basename(e.path) === 'templates') {
      return Promise.resolve([]);
    }
    return Promise.reject(e);
  });
}
407293
function html(strings, ...values) {
  let template = templateCache.get(strings);

  if (template === undefined) {
    template = new Template(strings, defaultTemplateProcessor);
    templateCache.set(strings, template);
  }

  return templateResult(template, values);
}
986190
@Override
    public String getTemplateURI(String controllerName, String templateName) {
        TupleStringKey key = new TupleStringKey(controllerName, templateName);
        String uri = templateURICache.get(key);
        if (uri == null) {
            uri = super.getTemplateURI(controllerName, templateName);
            String prevuri=templateURICache.putIfAbsent(key, uri);
            if (prevuri != null) {
                return prevuri;
            }
        }
        return uri;
    }