Specify a hierarchy of our templates.
189929
def get_layout():
    """"""
    tica_msm = TemplateDir(
        'tica',
        [
            'tica/tica.py',
            'tica/tica-plot.py',
            'tica/tica-sample-coordinate.py',
            'tica/tica-sample-coordinate-plot.py',
        ],
        [
            TemplateDir(
                'cluster',
                [
                    'cluster/cluster.py',
                    'cluster/cluster-plot.py',
                    'cluster/sample-clusters.py',
                    'cluster/sample-clusters-plot.py',
                ],
                [
                    TemplateDir(
                        'msm',
                        [
                            'msm/timescales.py',
                            'msm/timescales-plot.py',
                            'msm/microstate.py',
                            'msm/microstate-plot.py',
                            'msm/microstate-traj.py',
                        ],
                        [],
                    )
                ]
            )
        ]
    )
    layout = TemplateDir(
        '',
        [
            '0-test-install.py',
            '1-get-example-data.py',
            'README.md',
        ],
        [
            TemplateDir(
                'analysis',
                [
                    'analysis/gather-metadata.py',
                    'analysis/gather-metadata-plot.py',
                ],
                [
                    TemplateDir(
                        'rmsd',
                        [
                            'rmsd/rmsd.py',
                            'rmsd/rmsd-plot.py',
                        ],
                        [],
                    ),
                    TemplateDir(
                        'landmarks',
                        [
                            'landmarks/find-landmarks.py',
                            'landmarks/featurize.py',
                            'landmarks/featurize-plot.py',
                        ],
                        [tica_msm],
                    ),
                    TemplateDir(
                        'dihedrals',
                        [
                            'dihedrals/featurize.py',
                            'dihedrals/featurize-plot.py',
                        ],
                        [tica_msm],
                    )
                ]
            )
        ]
    )
    return layout
1290233
def make_template(name, func, *args, **kwargs):
  """"""
  if args or kwargs:
    func = functools.partial(func, *args, **kwargs)
  return Template(name, func)
334701
def build(template_directories):
    
    template = load_template(template_directories[0])
    for directory in template_directories[1:]:
        template.update(load_template(directory))
    return template
882923
function Templates(options) {
  if (!(this instanceof Templates)) {
    return new Templates(options);
  }

  Base.call(this, null, options);
  this.is('templates');
  this.define('isApp', true);
  this.use(utils.option());
  this.use(utils.plugin());
  this.initTemplates();
}
465882
def create_stack(
        self, 
        stack_name,
        stack_template_name,
        parameters=None,
        capabilities=None
        ):
        """"""
        # Build template_path
        stack_template_path = pathlib.Path(
            self.template_dir).joinpath(stack_template_name)

        # Create stack
        create_stack(
            stack_name,
            stack_template_path,
            parameters=parameters,
            capabilities=capabilities
        )
117726
public function templates($templates = null) {

        if ($templates !== null && ! is_string($templates)) {
            $this->_userChangedTemplates = array_merge(array_keys($templates), $this->_userChangedTemplates);
        }

        return parent::templates($templates);
    }
1218757
function template(files, staticPath) {
			return files ? files.map(function(filepath){
				paths = filepath.split(staticPath)[1].split('/')
				jsonpart = buildJsonPath(paths, filepath);
				return jsonpart;
			}) : ''
		}
289625
def create_template_context(self, element, **kwargs):
        """"""
        context = dict(element=element, **kwargs)
        if self.global_context:
            context.update(**self.global_context)
        return context
53794
def get_templates(self, context, template_name=None):
        "  "
        if not template_name:
            template_name = self.template_name

        kw = {}
        if 'object' in context:
            o = context['object']
            kw['slug'] = o.slug

        if context.get('content_type', False):
            ct = context['content_type']
            kw['app_label'] = ct.app_label
            kw['model_label'] = ct.model

        return get_templates(template_name, category=context['category'], **kw)
58696
def _set_hierarchy_view(self, session):
        """"""
        if self._hierarchy_view == COMPARATIVE:
            try:
                session.use_comparative_hierarchy_view()
            except AttributeError:
                pass
        else:
            try:
                session.use_plenary_hierarchy_view()
            except AttributeError:
                pass
220255
def get_base_templates():
    "  "

    return sorted(filter(
                  lambda x: op.isdir(op.join(TPL_DIR, x)),
                  listdir(TPL_DIR)))
1006142
def parse_template(template):
    """"""
    m = TEMPLATE_OVERRIDE_RE.match(template)
    if not m:
        return template, 0
    return m.group('template'), int(m.group('depth'))
552052
def template(cls, userdata):
        """"""
        ud = Userdata(cls.normalize(cls.create_empty(None), userdata))
        return ud
1018970
def _include_file(context, uri, calling_uri, **kwargs):
    """"""

    template = _lookup_template(context, uri, calling_uri)
    (callable_, ctx) = _populate_self_namespace(
                                context._clean_inheritance_tokens(),
                                template)
    callable_(ctx, **_kwargs_for_include(callable_, context._data, **kwargs))
1182120
protected function compile()
    {
        $this->Template->start = $this->getRelatedStart($this);
        $this->Template->stop = $this->getRelatedStop($this);
        $this->Template->separators = $this->getRelatedSeparators($this);


        $this->Template->start = $this->getRelatedStart($this);
        $this->Template->stop = $this->getRelatedStop($this);
        $this->Template->separators = $this->getRelatedSeparators($this);
        if ($this->getRelatedStart($this) !== null)
        {
            $this->Template->identifier = sprintf(static::$IDENTIFIER, $this->getRelatedStart($this)->id);
        }
    }
633702
def choose_template(self, template):
        '''
        '''
        n1 = int(template)/10
        n2 = int(template)%10
        self.send('^TS'+'0'+str(n1)+str(n2))
422965
public static function SetTemplates ($templates = []) {
		if (gettype(static::$templates) == 'array') {
			static::$templates = (array) $templates;
		} else {
			static::$templates = (object) $templates;
		}
		return static::$templates;
	}