generate url with url template
172785
def substitute(self, values: Dict[str, Any]) -> str:
        
        return self.template.substitute(values)
206258
def get_template(template_id, options = {})
      content_type = { 'Content-Type' => 'application/json' }
      content_type.merge(options[:headers]) if options[:headers]

      uri = build_uri("/accounts/#{acct_id}/templates/#{template_id}")

      http = initialize_net_http_ssl(uri)
      request = Net::HTTP::Get.new(uri.request_uri, headers(content_type))
      response = http.request(request)
      generate_log(request, response, uri)
      JSON.parse(response.body)
    end
317136
private function generateResourceTemplate()
    {
        $savePath = $this->getTemplateDir($this->bundle) . '/PageParts/'.$this->entity.'/view.html.twig';

        $params = array(
            'pagepart' => strtolower(
                    preg_replace('/([a-z])([A-Z])/', '$1-$2', str_ireplace('PagePart', '', $this->entity))
                ) . '-pp',
            'fields' => $this->fields,
        );
        $this->renderFile('/Resources/views/PageParts/view.html.twig', $savePath, $params);

        $this->assistant->writeLine('Generating template : <info>OK</info>');
    }
1036276
def __get_direct_template_url(self, name):
        
        url = self.pelican_settings.get('{}_SAVE_AS'.format(name.upper()))
        if url is None:
            url = self.settings.get('{}_URL'.format(name.upper()), '{}.html'.format(name))
        return urljoin(self.url_site, url)
1161923
def prepare_url(self, uri, kwargs):
        
        params = dict()
        for key in kwargs:
            if key in ('include', 'exclude', 'fields'):
                params.update({
                    key: ','.join(kwargs.get(key))
                })
            elif key in ('search', 'kind'):
                params.update({
                    key: kwargs.get(key)
                })

        if params:
            params = urlencode(params)
            uri = '%s?%s' % (uri, params)

        return uri
428328
def url_for(page)
      page_one = page == 1
      unless @url_string and !page_one
        @url_params = {}
        # page links should preserve GET parameters
        stringified_merge @url_params, @template.params if @template.request.get?
        stringified_merge @url_params, @options[:params] if @options[:params]
        
        if complex = param_name.index(/[^\w-]/)
          page_param = (defined?(CGIMethods) ? CGIMethods : ActionController::AbstractRequest).
            parse_query_parameters("#{param_name}=#{page}")
          
          stringified_merge @url_params, page_param
        else
          @url_params[param_name] = page_one ? 1 : 2
        end

        url = @template.url_for(@url_params)
        return url if page_one
        
        if complex
          @url_string = url.sub(%r!((?:\?|&amp;)#{CGI.escape param_name}=)#{page}!, '\1@')
          return url
        else
          @url_string = url
          @url_params[param_name] = 3
          @template.url_for(@url_params).split(//).each_with_index do |char, i|
            if char == '3' and url[i, 1] == '2'
              @url_string[i] = '@'
              break
            end
          end
        end
      end
      # finally!
      @url_string.sub '@', page.to_s
    end
767110
def _build_url(self, shorten=True):
        """"""
        self.url = URL_FORMAT.format(*self._get_url_params(shorten=shorten))
195100
def url
      @url ||= if @collection.nil?
                 relative_path
               else
                 ::Bunto::URL.new({
                   :template     => @collection.url_template,
                   :placeholders => placeholders,
                 })
               end.to_s.gsub(%r!/$!, "")
    end
1132030
def get_template(template_id, opts = {})
      data, _status_code, _headers = get_template_with_http_info(template_id, opts)
      data
    end
299058
function generatePath(route, params) {
    return route.pattern.replace(nameOrSplatParam, function(_, name) { return params[name]; });
  }
802947
private String generateContent(String templateFile) {
		try {
			GStringTemplateEngine gStringEngine = new GStringTemplateEngine();
			URL url = loadTemplate(templateFolder + "/" + templateFile);
			if (url == null) {
				logWarn("NO TEMPLATE FOUND FOR " + templateFile);
			} else {
				logDebug("Loaded template: " + url.getPath());
			}
			if (url == null) return null;
			
			Template template = gStringEngine.createTemplate(url);
			return template.make(modelMap).toString();
		} catch (Exception e) {
			ps.println("### ERROR: Failed generate templatefile: " + templateFile);
			e.printStackTrace(ps);
			return null;
		}
	}
713736
def get_template(self, template_id):
        ''' 

        '''
        request = self._get_request()
        return request.get(self.TEMPLATE_GET_URL + template_id)
1150153
function makeUrl(name, data) {

        if (! data['summary']){
            data['summary'] = data['description'];
        }

        return templates[name].replace(/\{\{(\w)(\w*)\}\}/g, function (m, fix, key) {
            var nameKey = name + fix + key.toLowerCase();
            key = (fix + key).toLowerCase();

            return encodeURIComponent((data[nameKey] === undefined ? data[key] : data[nameKey]) || '');
        });
    }
491529
def template(*args, **kwargs):
    '''
    
    '''
    tpl = args[0] if args else None
    template_adapter = kwargs.pop('template_adapter', SimpleTemplate)
    if tpl not in TEMPLATES or DEBUG:
        settings = kwargs.pop('template_settings', {})
        lookup = kwargs.pop('template_lookup', TEMPLATE_PATH)
        if isinstance(tpl, template_adapter):
            TEMPLATES[tpl] = tpl
            if settings: TEMPLATES[tpl].prepare(**settings)
        elif "\n" in tpl or "{" in tpl or "%" in tpl or '$' in tpl:
            TEMPLATES[tpl] = template_adapter(source=tpl, lookup=lookup, **settings)
        else:
            TEMPLATES[tpl] = template_adapter(name=tpl, lookup=lookup, **settings)
    if not TEMPLATES[tpl]:
        abort(500, 'Template (%s) not found' % tpl)
    for dictarg in args[1:]: kwargs.update(dictarg)
    return TEMPLATES[tpl].render(kwargs)
1285678
def generate_swagger_html(swagger_static_root, swagger_json_url):
    
    tmpl = _get_template("swagger.html")
    return tmpl.render(
        swagger_root=swagger_static_root, swagger_json_url=swagger_json_url
    )
1175058
def build_follow_url(host=None, **params):
        

        # template = '?{params}'
        config = ExampleConfig()
        template = '/follow?{params}'

        if not host:
            host = config.get('example_web_hostname')

        return ExampleUrlBuilder.build(
            template=template,
            host=host,
            params=ExampleUrlBuilder.encode_params(**params)
        )
351868
def generate_url(scheme=None, host=None, port=None, path=None, query=None):
    
    url = ""
    if scheme is not None:
        url += "%s://" % scheme
    if host is not None:
        url += host
    if port is not None:
        url += ":%s" % str(port)
    if path is not None:
        url += ensure_url_path_starts_with_slash(path)
    if query is not None:
        url += "?%s" % (urlencode(query))
    return url