Checks whether to include the template with the given name in the
database or not.

@param tpl
the template name
@return true, if the template should be included in the db
775806
public boolean acceptTemplate(String tpl)
	{

		if (isInWhiteList(tpl) && !isInBlackList(tpl)) {
			if (containsAllowedPrefix(tpl) && !containsRestrictedPrefix(tpl)) {
				return true;
			}
			else {
				return false;
			}
		}
		else {
			return false;
		}

	}
158718
public void addIncludeTemplateClass(TemplateClass tc) {
        includedTemplateClasses.add(tc);
        includeTagTypes.putAll(tc.includeTagTypes);
    }
1142204
protected boolean isTemplateContextCompatible(CmsTemplateContext templateContext) {

        Set<String> contextKeys = new HashSet<String>(templateContext.getProvider().getAllContexts().keySet());
        return contextKeys.equals(new HashSet<String>(TYPES));
    }
546826
private boolean containsAllowedPrefix(String tpl)
	{
		if (whitePrefixList.isEmpty())
			return true;

		for (String i : whitePrefixList) {
			if (tpl.startsWith(i))
				return true;
		}
		return false;
	}
137750
public function checkForUpdate(&$description)
    {
        if ($this->isWizardDone()) {
            return false;
        }

        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
        $queryBuilder->getRestrictions()->removeAll();
        $affectedRows = $queryBuilder->count('uid')
            ->from('tt_content')
            ->where(
                $queryBuilder->expr()->eq(
                    'list_type',
                    $queryBuilder->createNamedParameter('tt_address_pi1', \PDO::PARAM_STR)
                )
            )
            ->execute()->fetchColumn(0);

        $description = 'The flexform field templateFile is migrated to settings.displayMode. Custom templateFile\'s need to be added in settings.displayMode. Example: When templateFile is "my_template.html" then settings.displayMode is set to "my_template" and the template can be registered like TCEFORM.tt_content.pi_flexform.ttaddress_listview.sDISPLAY.settings\.displayMode.addItems.my_template = my_template';

        return (bool)$affectedRows;
    }
385705
def template_exists_db(self, template):
        
        name = utils.camel_to_snake(template[0]).upper()
        language = utils.camel_to_snake(template[3])
        try:
            models.EmailTemplate.objects.get(name=name, language=language)
        except models.EmailTemplate.DoesNotExist:
            return False
        return True
446085
public function useTemplate($template_name = false)
    {
        $templates = $this->getTemplates();

        // set the default template
        if ($template_name == false) {
            $template_name = $templates[0]->name;
        }

        // actually use the template
        if ($template_name) {
            $this->{$template_name}();
        }
    }
1172615
public function isNamed()
    {
        // If file is not array, then template
        // is not named for sure.
        if ( ! is_array($this->file)) {
            return false;
        }

        // Return false if template is named, but name 
        // is invalid. A valid name should be:
        if (
            isset($this->file[1]) && is_bool($this->file[1]) // should be set and not be a boolean
            || null === $this->file[1] // or null value
            || empty($this->file[1]) // or empty sting or array
        ) {
            return false;
        }

        return true;
    }
19261
public function setTemplate($tpl, $clearParams=true)
    {
        if ($clearParams) {
            $this->clearParams();
        }
        $this->templateFile = $this->templatesPath.$tpl.'.tpl.php';
    }
231216
public boolean recordTemplateTypeName(String name) {
    if (currentInfo.declareTemplateTypeName(name)) {
      populated = true;
      return true;
    } else {
      return false;
    }
  }
1008036
private synchronized boolean isIncluded(String _clazzName) {
        if (includes.size() > 0) {
            for (String include : includes) {
                if (_clazzName.startsWith(include)) {
                    return true;

                }
            }
        } // if we dont have a list, we include nothing (to prevent circular classloader dependencies)
        return false;
    }
1064431
public void addTemplate( String templateName, URLTemplate template )
    {
        if ( templateName == null || templateName.length() == 0 )
        {
            throw new IllegalArgumentException( "Template name cannot be null or empty." );
        }

        if ( template == null )
        {
            throw new IllegalArgumentException( "URLTemplate cannot be null." );
        }

        _templates.put( templateName, template );
    }
660694
private boolean isIncluded( VarNamePattern varNamePath)
    {
    // If no included patterns specified, include all variables.
    boolean included = getIncludedVars().isEmpty();
    if( !included)
      {
      // Otherwise, look for a matching pattern.
      Iterator<VarNamePattern> includedVars = getIncludedVars().iterator();
      while( includedVars.hasNext() && !(included = includedVars.next().matches( varNamePath)));
      }
    
    return included;
    }
159379
private boolean isIncluded(String className) {
    if (includes == null || includes.size() == 0) {
      // generate nothing if no include defined - it makes no sense to generate for all classes from classpath
      return false;
    }
    return includes.stream()
        .filter(pattern -> SelectorUtils.matchPath(pattern, className, ".", true))
        .count() > 0;
  }
1172279
private void checkTemplate(TemplateNode node, TemplateRegistry templateRegistry) {
    ListMultimap<String, SourceLocation> dataKeys = ArrayListMultimap.create();

    for (VarRefNode varRefNode : SoyTreeUtils.getAllNodesOfType(node, VarRefNode.class)) {
      if (varRefNode.isPossibleHeaderVar()) {
        dataKeys.put(varRefNode.getName(), varRefNode.getSourceLocation());
      }
    }

    IndirectParamsInfo ipi =
        new IndirectParamsCalculator(templateRegistry)
            .calculateIndirectParams(templateRegistry.getMetadata(node));

    Set<String> allHeaderVarNames = new HashSet<>();
    List<TemplateHeaderVarDefn> unusedParams = new ArrayList<>();
    // Process @param header variables.
    for (TemplateParam param : node.getAllParams()) {
      allHeaderVarNames.add(param.name());
      if (dataKeys.containsKey(param.name())) {
        // Good: Declared and referenced in template. We remove these from dataKeys so
        // that at the end of the for-loop, dataKeys will only contain the keys that are referenced
        // but not declared in SoyDoc.
        dataKeys.removeAll(param.name());
      } else if (ipi.paramKeyToCalleesMultimap.containsKey(param.name())
          || ipi.mayHaveIndirectParamsInExternalCalls
          || ipi.mayHaveIndirectParamsInExternalDelCalls) {
        // Good: Declared in SoyDoc and either (a) used in a call that passes all data or (b) used
        // in an external call or delcall that passes all data, which may need the param (we can't
        // verify).
      } else {
        // Bad: Declared in SoyDoc but not referenced in template.
        unusedParams.add(param);
      }
    }

    List<TemplateHeaderVarDefn> unusedStateVars = new ArrayList<>();
    // Process @state header variables.
    if (node instanceof TemplateElementNode) {
      TemplateElementNode el = (TemplateElementNode) node;
      for (TemplateStateVar stateVar : el.getStateVars()) {
        allHeaderVarNames.add(stateVar.name());
        if (dataKeys.containsKey(stateVar.name())) {
          // Good: declared and referenced in the template.
          dataKeys.removeAll(stateVar.name());
        } else {
          // Bad: declared in the header, but not used.
          unusedStateVars.add(stateVar);
        }
      }
    }
    // At this point, the only keys left in dataKeys are undeclared.
    for (Entry<String, SourceLocation> undeclared : dataKeys.entries()) {
      String extraErrorMessage =
          SoyErrors.getDidYouMeanMessage(allHeaderVarNames, undeclared.getKey());
      errorReporter.report(
          undeclared.getValue(), UNDECLARED_DATA_KEY, undeclared.getKey(), extraErrorMessage);
    }

    // Delegate templates can declare unused params because other implementations
    // of the same delegate may need to use those params.
    if (node instanceof TemplateBasicNode) {
      reportUnusedHeaderVars(errorReporter, unusedParams, UNUSED_PARAM);
    }
    if (node instanceof TemplateElementNode) {
      reportUnusedHeaderVars(errorReporter, unusedStateVars, UNUSED_STATE);
    }
  }
469773
def include_library(libname):
    """"""
    # For configuration phase we need to have exclude / include lists None
    # so these checking is skipped and library gets included.
    if exclude_list:
        if exclude_list.search(libname) and not include_list.search(libname):
            # Library is excluded and is not overriden by include list.
            # It should be then excluded.
            return False
        else:
            # Include library
            return True
    else:
        # By default include library.
        return True
408502
public function setTemplate( $layout_template )
	{
		$tpl_config = $this->config->getConfig( 'templates' );

		if ( !isset( $tpl_config[$layout_template] ) )
		{
			trigger_error( "Template file '$layout_template' not found." );
			return false;
		}

		$this->layout_template =  ROOT_PATH . '/'. $tpl_config[$layout_template];
	}