Extends an existing rabl template
 Example:
   extends 'users/base'
   extends ->(item) { "v1/#{item.class}/_core" }
   extends 'posts/base', locals: { hide_comments: true }
344405
def extends(path_or_lambda, options = nil)
      if path_or_lambda.is_a?(Proc)
        @template.add_node Nodes::Polymorphic.new(path_or_lambda)
        return
      end

      other = Library.instance.compile_template_from_path(path_or_lambda, @view)

      if options && options.is_a?(Hash)
        @template.add_node Nodes::Extend.new(other.nodes, options[:locals])
      else
        @template.extends(other)
      end
    end
720088
def wrap(ptr, base=None):
    
    if ptr is None:
        return None
    ptr = long(ptr) # Ensure type
    if base is None:
        qObj = shiboken.wrapInstance(long(ptr), QtCore.QObject)
        metaObj = qObj.metaObject()
        cls = metaObj.className()
        superCls = metaObj.superClass().className()
        if hasattr(QtGui, cls):
            base = getattr(QtGui, cls)
        elif hasattr(QtGui, superCls):
            base = getattr(QtGui, superCls)
        else:
            base = QtGui.QWidget
    return shiboken.wrapInstance(long(ptr), base)
608610
function extendNativeTypes() {
        extendIterablePrototype(Array.prototype, ["concat", "forEach", "indexOf", "join", "lastIndexOf", "reverse"]);
        var originalJoin = Array.prototype.join;
        Array.prototype.join = function () {
            for (var _len2 = arguments.length, args = Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
                args[_key3] = arguments[_key3];
            }

            if (args.length == 4 || args.length == 5) {
                var _collection$join;

                var collection = Collection.from(this);
                return (_collection$join = collection.join).call.apply(_collection$join, [collection].concat(args));
            }
            return originalJoin.call.apply(originalJoin, [this].concat(args));
        };
        var originalIndexOf = Array.prototype.indexOf;
        Array.prototype.indexOf = function () {
            for (var _len3 = arguments.length, args = Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
                args[_key4] = arguments[_key4];
            }

            if (args.length == 2 && __isFunction(args[1])) {
                var _collection$indexOf;

                var collection = Collection.from(this);
                return (_collection$indexOf = collection.indexOf).call.apply(_collection$indexOf, [collection].concat(args));
            }
            return originalIndexOf.call.apply(originalIndexOf, [this].concat(args));
        };
        var originalLastIndexOf = Array.prototype.lastIndexOf;
        Array.prototype.lastIndexOf = function () {
            for (var _len4 = arguments.length, args = Array(_len4), _key5 = 0; _key5 < _len4; _key5++) {
                args[_key5] = arguments[_key5];
            }

            if (args.length == 2 && __isFunction(args[1])) {
                var _collection$lastIndex;

                var collection = Collection.from(this);
                return (_collection$lastIndex = collection.lastIndexOf).call.apply(_collection$lastIndex, [collection].concat(args));
            }
            return originalLastIndexOf.call.apply(originalLastIndexOf, [this].concat(args));
        };
        extendIterablePrototype(Map.prototype, ["add", "forEach"]);
        extendIterablePrototype(Set.prototype, ["add", "forEach"]);
    }
820492
def _build_block_context(template, context):
    """"""

    # Ensure there's a BlockContext before rendering. This allows blocks in
    # ExtendsNodes to be found by sub-templates (allowing {{ block.super }} and
    # overriding sub-blocks to work).
    if BLOCK_CONTEXT_KEY not in context.render_context:
        context.render_context[BLOCK_CONTEXT_KEY] = BlockContext()
    block_context = context.render_context[BLOCK_CONTEXT_KEY]

    for node in template.nodelist:
        if isinstance(node, ExtendsNode):
            compiled_parent = node.get_parent(context)

            # Add the parent node's blocks to the context. (This ends up being
            # similar logic to ExtendsNode.render(), where we're adding the
            # parent's blocks to the context so a child can find them.)
            block_context.add_blocks(
                {n.name: n for n in compiled_parent.nodelist.get_nodes_by_type(BlockNode)})

            _build_block_context(compiled_parent, context)
            return compiled_parent

        # The ExtendsNode has to be the first non-text node.
        if not isinstance(node, TextNode):
            break
932494
def extend(*args):
    
    if not args:
        return {}

    first = args[0]
    rest = args[1:]
    out = type(first)(first)
    for each in rest:
        out.update(each)
    return out
1349274
function extend(src, props) {
		props = props || {};
		var p;
		for (p in src) {
			if (src.hasOwnProperty(p)) {
				if (!props.hasOwnProperty(p)) {
					props[p] = src[p];
				}
			}
		}
		return props;
	}
425470
def extendMarkdown(self, md, md_globals=None):
        """"""
        if any(
                x not in md.treeprocessors
                for x in self.REQUIRED_EXTENSION_INTERNAL_NAMES):
            raise RuntimeError(
                "The attr_cols markdown extension depends the following"
                " extensions which must preceded it in the extension"
                " list: %s" % ", ".join(self.REQUIRED_EXTENSIONS))
        processor = AttrColTreeProcessor(md, self.conf)
        md.treeprocessors.register(
            processor, 'attr_cols',
            5)
1332856
public void addExtendRelationship(TemplateClass parent, TemplateClass child) {
        if (mode().isProd()) return;
        Set<TemplateClass> children = extendMap.get(parent);
        if (null == children) {
            children = new HashSet<TemplateClass>();
            extendMap.put(parent, children);
        }
        children.add(child);
    }
558132
function expand(template, data) {
    if (template.indexOf("{{") >= 0) {
        let ast = myna.parsers.mustache(template);
        let lines = expandAst(ast, data);
        return lines.join("");
    } 
    else {
        return template;
    }
}
1125808
def render_template(self, template, **kwargs):
        
        kwargs["base_template"] = self.appbuilder.base_template
        kwargs["appbuilder"] = self.appbuilder
        return render_template(
            template, **dict(list(kwargs.items()) + list(self.extra_args.items()))
        )
732383
def extend(self, builder):
        
        for extension in self._extensions:
            getattr(self, '_add_%s' % extension)(builder)

        builder.on_delete(self._on_delete)
1239649
function extend(helper = {}) {
  Object.keys(plugins).forEach((key) => {
    const plugin = plugins[key]
    helper[key] = plugin.default.bind(helper)
  })
  helper.extend = (name, method) => {
    helper[name] = method.bind(helper)
  }
}
367402
def create(buildout_directory, buildout_extends):
    
    ##
    # Resolve arguments
    directory = get_buildout_directory(buildout_directory)
    extends = get_buildout_extends(buildout_extends)

    ##
    # 
    local('mkdir -p {0:s}'.format(directory))

    ##
    # Create buildout.cfg
    filename = os.path.join(directory, 'buildout.cfg')
    contents = """\
[buildout]
extends = {0:s}
""".format(extends)

    ##
    # Write buildout.cfg
    with NamedTemporaryFile() as output:
        print("[localhost] create: {0:s}".format(output.name))
        output.write(contents)
        output.flush()
        local('cp {0:s} {1:s}'.format(output.name, filename))
        local('chmod a+r {0:s}'.format(filename))
157718
def extend_and_specialize(items, loader):
    # type: (List[Dict[Text, Any]], Loader) -> List[Dict[Text, Any]]
    

    items = deepcopy_strip(items)
    types = {i["name"]: i for i in items}  # type: Dict[Text, Any]
    results = []

    for stype in items:
        if "extends" in stype:
            specs = {}  # type: Dict[Text, Text]
            if "specialize" in stype:
                for spec in aslist(stype["specialize"]):
                    specs[spec["specializeFrom"]] = spec["specializeTo"]

            exfields = []  # type: List[Text]
            exsym = []  # type: List[Text]
            for ex in aslist(stype["extends"]):
                if ex not in types:
                    raise Exception(
                        "Extends {} in {} refers to invalid base type.".format(
                            stype["extends"], stype["name"]))

                basetype = copy.copy(types[ex])

                if stype["type"] == "record":
                    if specs:
                        basetype["fields"] = replace_type(
                            basetype.get("fields", []), specs, loader, set())

                    for field in basetype.get("fields", []):
                        if "inherited_from" not in field:
                            field["inherited_from"] = ex

                    exfields.extend(basetype.get("fields", []))
                elif stype["type"] == "enum":
                    exsym.extend(basetype.get("symbols", []))

            if stype["type"] == "record":
                stype = copy.copy(stype)
                exfields.extend(stype.get("fields", []))
                stype["fields"] = exfields

                fieldnames = set()  # type: Set[Text]
                for field in stype["fields"]:
                    if field["name"] in fieldnames:
                        raise validate.ValidationException(
                            "Field name {} appears twice in {}".format(
                                field["name"], stype["name"]))
                    else:
                        fieldnames.add(field["name"])
            elif stype["type"] == "enum":
                stype = copy.copy(stype)
                exsym.extend(stype.get("symbols", []))
                stype["symbol"] = exsym

            types[stype["name"]] = stype

        results.append(stype)

    ex_types = {}
    for result in results:
        ex_types[result["name"]] = result

    extended_by = {}  # type: Dict[Text, Text]
    for result in results:
        if "extends" in result:
            for ex in aslist(result["extends"]):
                if ex_types[ex].get("abstract"):
                    add_dictlist(extended_by, ex, ex_types[result["name"]])
                    add_dictlist(extended_by, avro_name(ex), ex_types[ex])

    for result in results:
        if result.get("abstract") and result["name"] not in extended_by:
            raise validate.ValidationException(
                "{} is abstract but missing a concrete subtype".format(
                    result["name"]))

    for result in results:
        if "fields" in result:
            result["fields"] = replace_type(
                result["fields"], extended_by, loader, set())

    return results
101479
def substitute_template_values(endpoint, request_type, options={})
      # Gets the proper template for the give CUSTOM_SCHEMA string for this endpoint and substitutes value for it based on give options
      endpoint_templates = @schemas.fetch(request_type.to_sym, nil)
      template = endpoint_templates.fetch(endpoint.to_sym, nil) if endpoint_templates

      if template
        extracted_options, options = extract_template_options(options.merge({endpoint: endpoint}), template)
        # Render out the template
        rendered_template = Liquid::Template.parse(template).render(extracted_options)
      end

      return rendered_template, options
    end
275132
def extendsTree( self ):
        
        delegate = self.itemDelegate()
        if ( isinstance(delegate, XTreeWidgetDelegate) ):
            return delegate.extendsTree()
        return False
140443
function exposeTemplates(req, res, next) {
    // Uses the `ExpressHandlebars` instance to get the get the **precompiled**
    // templates which will be shared with the client-side of the app.
    hbs.getTemplates('shared/templates/', {
        cache      : app.enabled('view cache'),
        precompiled: true
    }).then(function (templates) {
        // RegExp to remove the ".handlebars" extension from the template names.
        var extRegex = new RegExp(hbs.extname + '$');

        // Creates an array of templates which are exposed via
        // `res.locals.templates`.
        templates = Object.keys(templates).map(function (name) {
            return {
                name    : name.replace(extRegex, ''),
                template: templates[name]
            };
        });

        // Exposes the templates during view rendering.
        if (templates.length) {
            res.locals.templates = templates;
        }

        setImmediate(next);
    })
    .catch(next);
}