Resolves a template path. You should not call this method.
503230
public function resolvePath(string $template)
    {
        foreach ($this->basedirs as $basedir) {
            $path = $basedir . self::SEPARATOR . $template . self::SUFFIX;
            $path = str_replace(self::SEPARATOR, DIRECTORY_SEPARATOR, $path);
            if (file_exists($path)) {
                return $path;
            }
        }
        // template not found
        throw new \LogicException('template not found: '.$template);
    }
838666
function resolve() {
    var resolvedPath = '';
    var resolvedAbsolute = false;
    var hasDomain = false;

    for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i -= 1) {
      var p = (i >= 0) ? arguments[i] : !hasDomain ? cwd() : '';

      if (!hasDomain) {
        hasDomain = isDomain(p);
      }

      if (!isString(p)) {
        throw new TypeError('Arguments to path.resolve must be strings');
      } else if (!p) {
        continue;
      }

      resolvedPath = p + '/' + resolvedPath;
      resolvedAbsolute = p[0] === '/';
    }

    resolvedPath = normalizeArray(resolvedPath.split('/'), !resolvedAbsolute).join('/');
    return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  }
561381
public function resolveErrorTemplate()
    {
        $this->buildTemplateIndex();

        $template = (array_key_exists(self::ERROR_TEMPLATE, $this->templateIndex)) ?
            $this->templateIndex[self::ERROR_TEMPLATE] :
            false;

        return($template);
    }
617285
@Override
    public Path resolve(final Path other) {
        if (other == null) {
            throw new IllegalArgumentException("other path must be specified");
        }

        if (other.isAbsolute()) {
            return other;
        }

        if (other.toString().length() == 0) {
            return this;
        }

        // Else join other to this
        final StringBuilder sb = new StringBuilder(this.path);
        if (!this.path.endsWith(ArchivePath.SEPARATOR_STRING)) {
            sb.append(ArchivePath.SEPARATOR);
        }
        sb.append(other.toString());
        final Path newPath = new ShrinkWrapPath(sb.toString(), this.fileSystem);
        return newPath;
    }
1130790
def find_template_from_path(filepath, paths=None):
    
    if paths is None or not paths:
        paths = [os.path.dirname(filepath), os.curdir]

    for path in paths:
        candidate = os.path.join(path, filepath)
        if os.path.exists(candidate):
            return candidate

    LOGGER.warning("Could not find template=%s in paths=%s", filepath, paths)
    return None
624252
protected function resolveTemplateFile(array $templates = array())
    {
        $templatePath = $this->getTemplatePath();

        $templates = array_merge($templates, $this->getDefaultTemplates());

        if (empty($templates)) {
            throw new Exception("No templates available.");
        }

        foreach ($templates as $templateFile) {
            $filePath = "$templatePath/$templateFile";

            if (is_file($filePath)) {
                return $filePath;
            }
        }

        return null;
    }
1267074
def close_scope(pop = true)
      if pop
        scope = @handler.scope.pop
      else
        scope = @handler.last
      end

      fail "template path already exists: #{scope.path}" if @handler.templates[scope.path]

      template = {
        'html' => scope.html
      }

      if scope.bindings.size > 0
        # Add the bindings if there are any
        template['bindings'] = scope.bindings
      end

      @handler.templates[scope.path] = template
    end
501590
def resolve_files(file_or_dir_path, options = {}, &block)
      options = {
        # Set to :template when calling to consider references to template
        # files from an import library
        import: false
      }.merge(options)
      [file_or_dir_path].flatten.each do |file_or_dir_path|
        path = inject_import_path(file_or_dir_path, type: options[:import]) if options[:import]
        path = clean_path_to(file_or_dir_path, options)
        self.base_directory = path unless options[:internal_call]
        if path.directory?
          Dir.glob("#{path}/*").sort.each do |file|
            resolve_files(file, { internal_call: true }.merge(options), &block)
          end
        else
          # Ignore files with the given prefix if supplied, but only if this is a file that
          # has been found, if explicitly asked to compile a file from the caller do it regardless
          if options[:ignore_with_prefix] && options[:internal_call]
            return nil if path.basename.to_s =~ /^#{options[:ignore_with_prefix]}/
          end
          yield path
        end
      end
    end
802258
function resolveTemplate(file, pathes) {
    var filePath = file.path,
        templateContent = '';

    for(var i = 0, len = pathes.length; i < len; i ++) {
        templateContent += fs.readFileSync(pathes[i], {encoding: 'utf-8'}) + "\r\n";
    }

    return templateContent;
}
546285
protected TemplateLoader getTemplateLoaderForPath(String templateLoaderPath) throws IOException {
        if (templateLoaderPath.startsWith(ResourceUtils.CLASSPATH_URL_PREFIX)) {
            String basePackagePath = templateLoaderPath.substring(ResourceUtils.CLASSPATH_URL_PREFIX.length());
            if (log.isDebugEnabled()) {
                log.debug("Template loader path [" + templateLoaderPath +
                        "] resolved to class path [" + basePackagePath + "]");
            }
            return new ClassTemplateLoader(environment.getClassLoader(), basePackagePath);
        } else if (templateLoaderPath.startsWith(ResourceUtils.FILE_URL_PREFIX)) {
            File file = new File(templateLoaderPath.substring(ResourceUtils.FILE_URL_PREFIX.length()));
            if (log.isDebugEnabled()) {
                log.debug("Template loader path [" + templateLoaderPath +
                        "] resolved to file path [" + file.getAbsolutePath() + "]");
            }
            return new FileTemplateLoader(file);
        } else {
            File file = new File(environment.getBasePath(), templateLoaderPath);
            if (log.isDebugEnabled()) {
                log.debug("Template loader path [" + templateLoaderPath +
                        "] resolved to file path [" + file.getAbsolutePath() + "]");
            }
            return new FileTemplateLoader(file);
        }
    }
502877
protected function resolveTemplate($template)
    {
        if (!$this->pathCache[$template]) {

            foreach (array_reverse($this->templateDirs) as $dir) {
                $path = $dir . DIRECTORY_SEPARATOR . $template .'.'. $this->getFileExtension();
                if (is_readable($path)) {
                    $this->pathCache[$template] = $path;
                    break;
                }
            }

        }

        return $this->pathCache[$template];
    }
669561
function resolvePath(_path, relativePath = currentWorkDir) {
  if (!isString(_path) || _path.startsWith('~')) {
    return _path;
  }
  const file = nativePath.relative(relativePath, _path);
  return nativePath.join(relativePath, file);
}
1024943
def resolve(context, path)
      context.resolve(path, content_type: 'text/css')
    rescue ::Sprockets::FileNotFound
      begin
        context.resolve(path + '/index', content_type: 'text/css')
      rescue
        nil
      end
    end
636046
protected function resolveCachedTemplatePath($templatePath)
    {
        if (isset($this->paths[$templatePath])) {
            $path = $this->paths[$templatePath];
        } else {
            $path = $this->finder->find($templatePath);
            if (null === $path) {
                throw new RuntimeException(sprintf(
                    '%s is not a valid readable template',
                    $templatePath
                ));
            }
            $this->paths[$templatePath] = $path;
        }

        return $path;
    }
617834
public function resolveNotFoundTemplate()
    {
        $this->buildTemplateIndex();

        $template = (array_key_exists(self::NOTFOUND_TEMPLATE, $this->templateIndex)) ?
            $this->templateIndex[self::NOTFOUND_TEMPLATE] :
            false;

        return($template);
    }
462134
def resolve_path(self, filename, skip='', skip_original='',
                     default_template=None):
        
        def _file(filename, dirs):
            for d in dirs:
                _f = os.path.normpath(os.path.join(d, filename))
                if os.path.exists(_f):
                    yield _f
            raise StopIteration

        filename = os.path.normpath(filename)
        skip = os.path.normpath(skip)
        skip_original = os.path.normpath(skip_original)

        if os.path.exists(filename):
            return filename

        if filename and self.dirs:
            _files = _file(filename, self.dirs)
            if skip_original == filename:
                for f in _files:
                    if f == skip:
                        break

            for f in _files:
                if f != skip:
                    return f
                else:
                    continue

        if default_template:
            if not isinstance(default_template, (tuple, list)):
                default_template = [default_template]
            for x in default_template:
                filename = self.resolve_path(x)
                if filename:
                    return filename
162803
protected function validateTemplatePath()
    {
        array_walk($this->templatePath, function($val, $key) {
            if (!is_dir($val)) {
                throw new \InvalidArgumentException(sprintf('Invalid template path: %s', $val));
            }
        });
    }