Return a method template for this method.
190988
def template(self):
        """"""
        r = fapi.get_config_template(self.namespace, self.name,
                                        self.snapshot_id, self.api_url)
        fapi._check_response_code(r, 200)
        return r.json()
558442
def model(method):
        """"""
        def wrapper(self, *args, **kwargs):
            if self.__model__ is None:
                raise ValidationError(
                    'You cannot perform CRUD operations without selecting a '
                    'model first.',
                )
            return method(self, *args, **kwargs)
        return wrapper
1239383
public static <T> SimpleTemplate<T> template(Class<? extends T> cl, String template, Object... args) {
        return simpleTemplate(cl, template, args);
    }
1028417
def template(*args, **kwargs):
    
    tpl = args[0] if args else None
    for dictarg in args[1:]:
        kwargs.update(dictarg)
    adapter = kwargs.pop('template_adapter', SimpleTemplate)
    lookup = kwargs.pop('template_lookup', TEMPLATE_PATH)
    tplid = (id(lookup), tpl)
    if tplid not in TEMPLATES or DEBUG:
        settings = kwargs.pop('template_settings', {})
        if isinstance(tpl, adapter):
            TEMPLATES[tplid] = tpl
            if settings: TEMPLATES[tplid].prepare(**settings)
        elif "\n" in tpl or "{" in tpl or "%" in tpl or '$' in tpl:
            TEMPLATES[tplid] = adapter(source=tpl, lookup=lookup, **settings)
        else:
            TEMPLATES[tplid] = adapter(name=tpl, lookup=lookup, **settings)
    if not TEMPLATES[tplid]:
        abort(500, 'Template (%s) not found' % tpl)
    return TEMPLATES[tplid].render(kwargs)
999965
def get_templates(model):
    
    for template_name, template in templates.items():
        if issubclass(template.model, model):
            yield (template_name, template.layout._meta.verbose_name)
918537
public ASTMethod getMethod(Method method) {

        ImmutableList<ASTParameter> astParameters = getParameters(method);
        ASTAccessModifier modifier = ASTAccessModifier.getModifier(method.getModifiers());
        ImmutableSet<ASTType> throwsTypes = getTypes(method.getExceptionTypes());

        return new ASTClassMethod(method, getType(method.getReturnType(), method.getGenericReturnType()), astParameters, modifier, getAnnotations(method), throwsTypes);
    }
1140477
function template(str, params){
  return str.replace(/%(\w*)%/g, function(m, key){
    return params[key];
  });
}
1267850
function buildMethodMap(methods) {
  // Makes a fake set of initial methods
  var methodMap = {};
  methods.forEach(function(method) {
    methodMap[method.name] = getMethod(method.name);
  });
  return methodMap;
}
719231
def template_string(context, template):
    ''
    if not isinstance(context, Context):
        context = Context(context)
    return Template(template).render(context)
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
748922
def templates(self):
        """"""
        template = lib.EnvGetNextDeftemplate(self._env, ffi.NULL)

        while template != ffi.NULL:
            yield Template(self._env, template)

            template = lib.EnvGetNextDeftemplate(self._env, template)
244779
private static String getMethodName(MethodSymbol methodSym) {
    return String.format("%s#%s", methodSym.owner, methodSym.getSimpleName());
  }
869096
private static MethodInfo getTemplateSubstituteMethod(InputStream in) throws IOException {

        ClassFile classFile = ClassFile.readFrom(in);

        MethodInfo substituteMethod = null;
        MethodInfo[] all = classFile.getMethods();

        // find the execute method on this template
        for (int i = 0; i < all.length; i++) {

            if ("substitute".equals(
                all[i].getName()) &&
                all[i].getMethodDescriptor().getParameterCount() == 1) {
                substituteMethod = all[i];
                break;
            }
        }
        in.close();
        return substituteMethod;
    }
551451
private static function getMethodsTemplate(array $reflectionMethods): string
    {
        $template = "";
        foreach ($reflectionMethods as $reflectionMethod) {
            $methodName = $reflectionMethod->getName();

            // not to overrided method
            if ($reflectionMethod->isConstructor() || $reflectionMethod->isStatic() || strpos($methodName, '__') !== false) {
                continue;
            }

            // the template of parameter
            $template .= " public function $methodName (";
            $template .= self::getParameterTemplate($reflectionMethod);
            $template .= ' ) ';

            // the template of return type
            $reflectionMethodReturn = $reflectionMethod->getReturnType();
            if ($reflectionMethodReturn !== null) {
                $returnType = $reflectionMethodReturn->__toString();
                $returnType = ($returnType == 'self') ? $reflectionMethod->getDeclaringClass()->getName() : $returnType;
                $template   .= " : $returnType";
            }

            // overrided method
            $template
                .= "{
                \$params = func_get_args();
                return \$this->call('{$methodName}', \$params);
            }
            ";
        }

        return $template;
    }
856759
def call(self, methodname, *args, **kwargs):
        """"""

        for plugin in self._plugins:
            method = getattr(plugin, methodname, None)
            if method is None:
                continue
            yield method(*args, **kwargs)
710363
def get_page_templates():
    """"""
    PAGE_TEMPLATES = get_setting('PAGE_TEMPLATES',
        default_value=())
    if isinstance(PAGE_TEMPLATES, collections.Callable):
        return PAGE_TEMPLATES()
    else:
        return PAGE_TEMPLATES
344629
function(template) {
        if (typeof template === 'function') {
            template = template.call(null, Toolkit.bem, Toolkit.namespace);
        }

        return template + '';
    }