Applies a similar URL-building technique as Bunto::Document that takes
 the collection's URL template into account. The default URL template can
 be overriden in the collection's configuration in _config.yml.
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
1206418
def template_body
      custom_template = "#{Ufo.root}/.ufo/settings/cfn/stack.yml"
      path = if File.exist?(custom_template)
               custom_template
             else
               # built-in default
               File.expand_path("../cfn/stack.yml", File.dirname(__FILE__))
             end
      RenderMePretty.result(path, context: context.scope)
    end
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
1148659
def url(self):
        
        if self._partition_key:
            base_url = self.design_doc.document_partition_url(
                self._partition_key)
        else:
            base_url = self.design_doc.document_url

        return '/'.join((
            base_url,
            '_view',
            self.view_name
        ))
526701
private function copyTemplates()
    {
        $dirPath = $this->bundle->getPath();
        $this->filesystem->copy($this->skeletonDir . '/Resources/views/Pages/FormPage/view.html.twig', $dirPath . '/Resources/views/Pages/'.$this->entity.'/view.html.twig', true);
        $this->filesystem->copy($this->skeletonDir . '/Resources/views/Pages/FormPage/pagetemplate.html.twig', $dirPath . '/Resources/views/Pages/'.$this->entity.'/pagetemplate.html.twig', true);
        GeneratorUtils::replace('~~~BUNDLE~~~', $this->bundle->getName(), $dirPath . '/Resources/views/Pages/'.$this->entity.'/pagetemplate.html.twig');

        GeneratorUtils::prepend("{% extends '" . $this->bundle->getName() .":Page:layout.html.twig' %}\n", $dirPath . '/Resources/views/Pages/'.$this->entity.'/view.html.twig');
    }
284304
function getOrCreateTemplateContentsOwner(template) {
    var doc = template.ownerDocument
    if (!doc.defaultView)
      return doc;
    var d = doc.templateContentsOwner_;
    if (!d) {
      // TODO(arv): This should either be a Document or HTMLDocument depending
      // on doc.
      d = doc.implementation.createHTMLDocument('');
      while (d.lastChild) {
        d.removeChild(d.lastChild);
      }
      doc.templateContentsOwner_ = d;
    }
    return d;
  }
300205
def _generate_openapi_object(document):
    
    parsed_url = urlparse.urlparse(document.url)

    swagger = OrderedDict()

    swagger['swagger'] = '2.0'
    swagger['info'] = OrderedDict()
    swagger['info']['title'] = document.title
    swagger['info']['description'] = document.description
    swagger['info']['version'] = document.version

    if parsed_url.netloc:
        swagger['host'] = parsed_url.netloc
    if parsed_url.scheme:
        swagger['schemes'] = [parsed_url.scheme]

    swagger['paths'] = _get_paths_object(document)

    return swagger
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)
591714
def _create_template(self, name):
        
        url = '%s/%s' % (self._base_url, escape.url_escape(name))
        LOGGER.debug('Making HTTP GET request to %s', url)
        response = self._http_client.fetch(url)
        data = json.loads(response.body, ensure_ascii=False)
        return template.Template(data['template'], name=name, loader=self)
636981
def _setup_default_templates(settings, path, prompt=True):
    
    project_templates = [{
        "name": "Basic Bootstrap 3 template",
        "url": "https://github.com/tarbell-project/tarbell-template",
    }, {
        "name": "Searchable map template",
        "url": "https://github.com/tarbell-project/tarbell-map-template",
    }, {
        "name": "Tarbell template walkthrough",
        "url": "https://github.com/tarbell-project/tarbell-tutorial-template",
    }]
    for project in project_templates:
        puts("+ Adding {0} ({1})".format(project["name"], project["url"]))

    puts("\n- Done configuring project templates.")
    return {"project_templates": project_templates}
125488
private function buildUrl()
    {
        $url = 'mongodb://' . ($this->config['username'] ? "{$this->config['username']}" : '') . ($this->config['password'] ? ":{$this->config['password']}@" : '');

        $hostList = explode(',', $this->config['hostname']);
        $portList = explode(',', $this->config['hostport']);

        for ($i = 0; $i < count($hostList); $i++) {
            $url = $url . $hostList[$i] . ':' . $portList[0] . ',';
        }

        return rtrim($url, ",") . '/';
    }
363701
def url(page)
      @base_url_params ||= begin
                             url_params = merge_get_params(default_url_params)
                             merge_optional_params(url_params)
                           end

      url_params = @base_url_params.dup
      add_current_page_param(url_params, page)

      # Add optional url_builder support
      (@options[:url_builder] || @template).url_for(url_params)
    end
345967
def build_urls(self: NodeVisitor, node: inheritance_diagram) -> Mapping[str, str]:
    
    current_filename = self.builder.current_docname + self.builder.out_suffix
    urls = {}
    for child in node:
        # Another document
        if child.get("refuri") is not None:
            uri = child.get("refuri")
            package_path = child["reftitle"]
            if uri.startswith("http"):
                _, _, package_path = uri.partition("#")
            else:
                uri = (
                    pathlib.Path("..")
                    / pathlib.Path(current_filename).parent
                    / pathlib.Path(uri)
                )
                uri = str(uri).replace(os.path.sep, "/")
            urls[package_path] = uri
        # Same document
        elif child.get("refid") is not None:
            urls[child["reftitle"]] = (
                "../" + current_filename + "#" + child.get("refid")
            )
    return urls
325229
def url(self):
        
        if not self.abstract:
            return "%s/documents/%i" % ("/".join(self._api.base_url.split("/")[:-2]), self.id)
713736
def get_template(self, template_id):
        ''' 

        '''
        request = self._get_request()
        return request.get(self.TEMPLATE_GET_URL + template_id)
1304837
def get_template_from_request(request, page=None):
    
    page_templates = settings.get_page_templates()
    if len(page_templates) == 0:
        return settings.PAGE_DEFAULT_TEMPLATE
    template = request.REQUEST.get('template', None)
    if template is not None and \
            (template in dict(page_templates).keys() or
            template == settings.PAGE_DEFAULT_TEMPLATE):
        return template
    if page is not None:
        return page.get_template()
    return settings.PAGE_DEFAULT_TEMPLATE
1008967
public UriTemplate build() throws MalformedUriTemplateException
    {
        UriTemplate template = new UriTemplate(this.components);
        if (this.values != null)
        {
            template.set(values);
        }

        if (defaultDateTimeFormatter != null)
        {
            template.defaultDateTimeFormatter = defaultDateTimeFormatter;
        }
        return template;
    }