Returns whether the given name is in the current Template's template group.
15534
def _TemplateExists(unused_value, context, args):
    """"""
    try:
        name = args[0]
    except IndexError:
        raise EvaluationError('The "template" predicate requires an argument.')
    return context.HasTemplate(name)
70618
private boolean isSameGroup(Node node) {
        return node.getNodeType().equals(appContext.getConfig().getNodeType())
                && node.getGroup().equals(appContext.getConfig().getNodeGroup());
    }
1173262
def member_of(self, group):
        
        if isinstance(group, Group):
            group = group.name
        return self.groups.filter(name=group).exists()
854103
public function hasRoutableTemplates()
    {
        $this->buildTemplateIndex();

        $routable = false;

        foreach ($this->templateIndex as $name => $template) {
            if (($name !== self::INDEX_TEMPLATE) && ($name !== self::NOTFOUND_TEMPLATE)) {
                $routable = true;
                break;
            }
        }

        return($routable);
    }
1237526
def tag_is_directive?(tag_name)
      list = %w(attribute endgroup group macro method scope visibility)
      list.include?(tag_name)
    end
1286055
private boolean maybeUseNativeClassTemplateNames(JSDocInfo info) {
    // TODO(b/74253232): maybeGetNativeTypesOfBuiltin should also handle cases where a local type
    // declaration shadows a templatized native type.
    ImmutableList<TemplateType> nativeKeys = typeRegistry.maybeGetTemplateTypesOfBuiltin(fnName);
    // TODO(b/73386087): Make infoTemplateTypeNames.size() == nativeKeys.size() a
    // Preconditions check. It currently fails for "var symbol" in the externs.
    if (nativeKeys != null && info.getTemplateTypeNames().size() == nativeKeys.size()) {
      this.templateTypeNames = nativeKeys;
      return true;
    }
    return false;
  }
393856
public function hasGroup($name)
    {
        if ($name instanceof GroupInterface) {
            return $this->groups->contains($name);
        }

        return $this->groups->containsKey($name);
    }
1373813
def find_template(self, name):
        """"""
        deftemplate = lib.EnvFindDeftemplate(self._env, name.encode())
        if deftemplate == ffi.NULL:
            raise LookupError("Template '%s' not found" % name)

        return Template(self._env, deftemplate)
770286
public TemplateClass getByClassName(String name) {
        TemplateClass tc = clsNameIdx.get(name);
        checkUpdate(tc);
        return tc;
    }
1292160
protected function templateExists($template)
    {
        $loader = $this->twig->getLoader();
        if ($loader instanceof ExistsLoaderInterface) {
            return $loader->exists($template);
        }

        try {
            if ($loader instanceof SourceContextLoaderInterface || method_exists($loader, 'getSourceContext')) {
                $loader->getSourceContext($template);
            } else {
                $loader->getSource($template);
            }

            return true;
        } catch (LoaderError $e) {
        }

        return false;
    }
1030501
public static boolean is(@NotNull Page page, @NotNull String @NotNull... templatePaths) {
    if (page == null || templatePaths == null || templatePaths.length == 0) {
      return false;
    }
    String templatePath = page.getProperties().get(NameConstants.PN_TEMPLATE, String.class);
    for (String givenTemplatePath : templatePaths) {
      if (StringUtils.equals(templatePath, givenTemplatePath)) {
        return true;
      }
    }
    return false;
  }
58404
private Template getTemplate(String templateName) throws ParseException {
    try {
      return config.getTemplate(templateName, "UTF-8");
    } catch (ParseException e) {
      throw e;
    } catch (IOException e) {
      logger.error("Couldn't load template '{}',loader is {}", templateName,
          config.getTemplateLoader().getClass());
      throw Throwables.propagate(e);
    }
  }
537669
def disable_template(name)
      name = name.to_sym

      return false if @disabled_templates.include?(name)

      if (template_dir = Template.templates[name])
        source_paths.delete(template_dir)

        @templates.delete_if { |template| template.path == template_dir }
        @enabled_templates.delete(name)
      end

      @disabled_templates << name
      return true
    end
773990
def _get_template(self, template_name):
        
        if template_name not in self.chached_templates:
            self.chached_templates[template_name] = self.env.get_template(template_name)
        return self.chached_templates[template_name]
15973
def is_theme(self, name):
        """"""
        return getattr(self.args, 'theme_' + name) or self.theme['name'] == name
215065
private boolean hasModelGroupAncestor(CmsJspStandardContextBean standardContext) {

        boolean result = false;
        if (!standardContext.isModelGroupPage()) {
            CmsContainerElementWrapper parent = standardContext.getElement();
            while ((parent != null) && !result) {
                result = parent.isModelGroup();
                parent = parent.getParent();
            }
        }
        return result;
    }
1037995
protected function templateExists($template)
    {
        $loader = $this->twig->getLoader();
        if (method_exists($loader, 'exists')) {
            return $loader->exists($template);
        }

        try {
            // cast possible TemplateReferenceInterface to string because the
            // EngineInterface supports them but Twig_LoaderInterface does not
            $loader->getSource($template)->getCode();
        } catch (\Twig_Error_Loader $e) {
            return false;
        }

        return true;
    }