Return a fully-qualified organization_inspect_template string.
324707
def organization_inspect_template_path(cls, organization, inspect_template):
        """"""
        return google.api_core.path_template.expand(
            "organizations/{organization}/inspectTemplates/{inspect_template}",
            organization=organization,
            inspect_template=inspect_template,
        )
123045
def organization_deidentify_template_path(cls, organization, deidentify_template):
        """"""
        return google.api_core.path_template.expand(
            "organizations/{organization}/deidentifyTemplates/{deidentify_template}",
            organization=organization,
            deidentify_template=deidentify_template,
        )
341957
def get_template(self, template_name):
        """"""
        try:
            return self.loader.load(template_name, encoding=self.encoding)
        except self.not_found_exception, e:
            # catch the exception raised by Genshi, convert it into a werkzeug
            # exception (for the sake of consistency)
            raise TemplateNotFound(template_name)
532426
def _get_template(querystring_key, mapping):
    """"""
    default = None
    try:
        template_and_keys = mapping.items()
    except AttributeError:
        template_and_keys = mapping
    for template, key in template_and_keys:
        if key is None:
            key = PAGE_LABEL
            default = template
        if key == querystring_key:
            return template
    return default
915218
def getTemplate(self, copied_from, template_name=None,
                    template_folder=None, keep=False, encoding="UTF-8"):
        

        return self.templater.getTemplate(copied_from,
                                          template_name=template_name,
                                          template_folder=template_folder,
                                          keep=keep,
                                          encoding=encoding)
788696
def get_template(self, context, **kwargs):
        
        if 'template' in kwargs['params']:
            self.template = kwargs['params']['template']
        return super(GoscaleTemplateInclusionTag, self).get_template(context, **kwargs)
302820
def __getTemplate(template_file_name):
        
        with open(template_file_name) as template_file:
            template_raw = template_file.read()

        template = parse(template_raw)
        return template
212263
def _get_template_for_given_resolution(self, res, return_):
        """"""
        path = self._layer_files[self._res_indices[res][0]]
        if return_ == "path":
            return_value = path
        else:
            with rasterio.open(str(path)) as src:
                if return_ == "meta":
                    return_value = src.meta
                elif return_ == "windows":
                    return_value = tuple(src.block_windows())
                else:
                    raise ValueError("'return_' must be 'path', meta' or 'windows'.")
        return return_value
900670
def get_template(template):
    """"""
    with open(os.path.join(template_dir, template) + template_ext, "r") as template_file:
        return template_file.read()
177811
def find_templates():
    
    templates = []
    templates_directory = (inspect.getsourcefile(lambda: 0).rstrip('__init__.py') +
                           'templates')
    template_files = os.listdir(templates_directory)
    for template_file in template_files:
        if template_file.startswith('.') or not template_file.endswith('.py'):
            continue
        # Hack for dev development and disutils
        try:
            template_module = importlib.import_module('templates.{}'.format(
               template_file.rstrip('.py')
            ))
        except ImportError:
            template_module = importlib.import_module('ross.templates.{}'.format(
               template_file.rstrip('.py')
            ))
        # Iterate throw items in template.
        # If there are variable ends with 'templates',
        # extend templates list with it.
        for (name, content) in template_module.__dict__.items():
            if name.endswith('templates'):
                for (regex_text, data_func) in content:
                    templates.append((re.compile(regex_text, re.IGNORECASE), data_func))
    return templates
154267
def get_extract_command_template(filename):
  """"""
  for k, v in iteritems(EXTRACT_COMMAND):
    if filename.endswith(k):
      return v
  return None
837878
String spanIndexTemplate() {
    String result =
        "{\n"
            + "  \"TEMPLATE\": \"${__INDEX__}:"
            + SPAN
            + "-*\",\n"
            + "  \"settings\": {\n"
            + "    \"index.number_of_shards\": ${__NUMBER_OF_SHARDS__},\n"
            + "    \"index.number_of_replicas\": ${__NUMBER_OF_REPLICAS__},\n"
            + "    \"index.requests.cache.enable\": true,\n"
            + "    \"index.mapper.dynamic\": false,\n"
            + "    \"analysis\": {\n"
            + "      \"analyzer\": {\n"
            + "        \"traceId_analyzer\": {\n"
            + "          \"type\": \"custom\",\n"
            + "          \"tokenizer\": \"keyword\",\n"
            + "          \"filter\": \"traceId_filter\"\n"
            + "        }\n"
            + "      },\n"
            + "      \"filter\": {\n"
            + "        \"traceId_filter\": {\n"
            + "          \"type\": \"pattern_capture\",\n"
            + "          \"patterns\": [\"([0-9a-f]{1,16})$\"],\n"
            + "          \"preserve_original\": true\n"
            + "        }\n"
            + "      }\n"
            + "    }\n"
            + "  },\n";
    if (searchEnabled) {
      return result
          + ("  \"mappings\": {\n"
              + "    \"_default_\": {\n"
              + "      DISABLE_ALL" // don't concat all fields into big string
              + "      \"dynamic_templates\": [\n"
              + "        {\n"
              + "          \"strings\": {\n"
              + "            \"mapping\": {\n"
              + "              KEYWORD,\n"
              + "              \"ignore_above\": 256\n"
              + "            },\n"
              + "            \"match_mapping_type\": \"string\",\n"
              + "            \"match\": \"*\"\n"
              + "          }\n"
              + "        }\n"
              + "      ]\n"
              + "    },\n"
              + "    \""
              + SPAN
              + "\": {\n"
              + "      \"_source\": {\"excludes\": [\"_q\"] },\n"
              + "      \"properties\": {\n"
              + "        \"traceId\": ${__TRACE_ID_MAPPING__},\n"
              + "        \"name\": { KEYWORD },\n"
              + "        \"localEndpoint\": {\n"
              + "          \"type\": \"object\",\n"
              + "          \"dynamic\": false,\n"
              + "          \"properties\": { \"serviceName\": { KEYWORD } }\n"
              + "        },\n"
              + "        \"remoteEndpoint\": {\n"
              + "          \"type\": \"object\",\n"
              + "          \"dynamic\": false,\n"
              + "          \"properties\": { \"serviceName\": { KEYWORD } }\n"
              + "        },\n"
              + "        \"timestamp_millis\": {\n"
              + "          \"type\":   \"date\",\n"
              + "          \"format\": \"epoch_millis\"\n"
              + "        },\n"
              + "        \"duration\": { \"type\": \"long\" },\n"
              + "        \"annotations\": { \"enabled\": false },\n"
              + "        \"tags\": { \"enabled\": false },\n"
              + "        \"_q\": { KEYWORD }\n"
              + "      }\n"
              + "    }\n"
              + "  }\n"
              + "}");
    }
    return result
        + ("  \"mappings\": {\n"
            + "    \"_default_\": { DISABLE_ALL },\n"
            + "    \""
            + SPAN
            + "\": {\n"
            + "      \"properties\": {\n"
            + "        \"traceId\": ${__TRACE_ID_MAPPING__},\n"
            + "        \"annotations\": { \"enabled\": false },\n"
            + "        \"tags\": { \"enabled\": false }\n"
            + "      }\n"
            + "    }\n"
            + "  }\n"
            + "}");
  }
599082
def get_template(self, uri):
        

        try:
            if self.filesystem_checks:
                return self._check(uri, self._collection[uri])
            else:
                return self._collection[uri]
        except KeyError:
            u = re.sub(r'^\/+', '', uri)
            for dir in self.directories:
                srcfile = posixpath.normpath(posixpath.join(dir, u))
                if os.path.isfile(srcfile):
                    return self._load(srcfile, uri)
            else:
                raise exceptions.TopLevelLookupException(
                                    "Cant locate template for uri %r" % uri)
1285043
def _get_template(self):
        
        loader = PackageLoader(self._package_name, 'assets/templates')
        env = Environment(extensions=['jinja2.ext.with_'], loader=loader)
        return env.get_template('{}.html'.format(self._report_name))
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
571586
def template_from_filename(filename):
    """"""
    ext = filename.split(os.path.extsep)[-1]
    if not ext in TEMPLATES_MAP:
        raise ValueError("No template for file extension {}".format(ext))
    return TEMPLATES_MAP[ext]
35216
def grok_template_file(src):
    """"""
    if not src.startswith('builtin:'):
        return abspath(src)

    builtin = src.split(':')[1]
    builtin = "templates/%s.j2" % builtin
    return resource_filename(__name__, builtin)