Loads the demo template.
@return {Promise} Returns promise for loading template as successful/failure.
358300
function loadTemplate() {
  generateData();

  return new Promise(function(resolve, reject) {

    // Load handlebars page template.
    $.get('src/demo-template.html', function(response) {
      template = response;
      render();
      resolve();
    }).fail(function() {
      reject();
    });
  });
}
664314
function (path, next) {
      var t$ = this;
      // Check Cache
      if ($.inArray(path, t$.cache) > -1) {
        return next && next()
      }

      // Use jQuery Ajax to fetch the template file
      var _templateLoader = $.get(path)
        .success(function (result) {
          if ($.inArray(path, t$.cache) === -1) {
            t$.cache.push(path);
            // On success, Add templates to DOM (assumes file only has template definitions)
            $('body').append(result);
          }
        })
        .error(function (result) {
          alert('Error Loading Templates -- TODO: Better Error Handling');
        });

      _templateLoader.complete(function () {
        // Publish an event that indicates when a template is done loading
        $(host).trigger('TEMPLATE_LOADED', [path]);
        next && next();
      });
    }
668506
function loadWithPromise (options) {
  return new Promise((resolve, reject) => {
    loadWithCallback(options, (error, config) => {
      if (error) {
        reject(error)
      } else {
        resolve(config)
      }
    })
  })
}
61735
function(tplname, tplargs, tplloader) {
            tplname = tplname || this.template;
            tplargs = tplargs || _.result(this, "templateContext");
            tplloader = tplloader || _.result(this, "templateLoader");

            var tpl = new Template({
                template: tplname,
                args: tplargs,
                loader: tplloader,
                view: this
            });
            return tpl.render();
        }
584944
function renderTemplate(template, context) {
			try {
				var func = _.template(template.template);
				return func(context);
			}
			catch (e) {
				grunt.fail.fatal('Error while rendering template ' + template.filename + ': ' + e.message);
			}
		}
481992
function loadTemplates (dirs, options) {
    // require dirs to be array
    if (!Array.isArray(dirs)) {
        dirs = [dirs]
    }
    // templates indexed by absolute file name
    var templates = {}
    // load all templates in all directories
    return Promise.each(dirs, dir => {
        // load all files under dir
        return globby('**/*'+GLOBAL.ext, {
            cwd: dir,
            follow: true,
        })
        // compile templates for files
        .then(files => {
            return loadTemplatesFiles(dir, files, options, templates)
        })
    })
    // resolve with templates
    .then(() => templates)
}
542541
function load() {
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  params = (0, _lodash.defaults)({}, params, {
    locale: 'en_US'
  });
  return new Promise(function (resolve, reject) {
    if (window.FB) {
      return resolve(window.FB);
    }

    var src = '//connect.facebook.net/' + params.locale + '/sdk.js';
    var script = document.createElement('script');
    script.id = 'facebook-jssdk';
    script.src = src;
    script.async = true;
    script.addEventListener('load', function () {
      return resolve(window.FB);
    }, false);
    script.addEventListener('error', function () {
      return reject('Error loading Facebook JS SDK from ' + src);
    }, false);

    var sibling = document.getElementsByTagName('script')[0];
    sibling.parentNode.insertBefore(script, sibling);
  });
}
965821
function()
    {
        if (this._executePromise)
            return this._executePromise;

        var q = this.clone();

        var table  = q._T.__name__;
        var page   = q._page;
        var fields = q._fields;

        // Create the query from our stuff
        var query = {};
        _(q._where.concat(q._like)).each(function (q) {
            query[q.key] = q.value;
        });

        var doneLoading      = Q.defer();
        this._executePromise = doneLoading.promise;

        var left = q._take;

        // A single iteration of fetching via the API. Called repeatedly in
        // the case of large / unbounded TAKES
        var loop = function() {

            // always take 1000 unless we're almost done
            var take = left < 1000 ? left : 1000;

            // Hit the API and incremement the page
            q._fetch(table, take, page++, query, fields).then(function(res) {

                // publish progress
                doneLoading.notify(q._results.length);

                if (left !== undefined) left -= res.length;

                // Either resolve the the promise with the results if we're
                // done or call the loop again

                if (q._doneLoading || left <= 0)
                    doneLoading.resolve(q._getResults());
                else
                    process.nextTick(loop);

            }).catch(function(err) {
                doneLoading.reject(err);
            });
        };

        // do tha damn thing
        loop();
        return doneLoading.promise;
    }
772462
def project_templates
      response = self.class.get '/project_templates.json'
      handle_response(response, Proc.new {|h| Logan::ProjectTemplate.new(h) })
    end
1117349
function controllerTemplateRouteResponse() {
    if (this.template) {
        let match = this.template.toString().match(/!doctype ([a-z]+)/i),
            mime;

        // In the context where MIME type is not set, but we have a
        // DOCTYPE tag, we can force set the MIME
        // We want this here instead of the explicit template definition
        // in case the MIME failed earlier
        if (match && !this.response.$headers.hasOwnProperty('Content-Type')) {
            mime = this.response.$headers[ 'Content-Type' ] =
                $MimeType.$$(match[1].toLowerCase());
        }

        // Check to see if this is an HTML template and has a DOCTYPE
        // and that the proper configuration options are set
        if (
            mime === 'text/html' &&
            config.loadDefaultScriptFile &&
            (
                this.route.hasOwnProperty('useDefaultScriptFile') ||
                this.route.useDefaultScriptFile !== false
            )
        ) {

            // Check that option is not true
            let scriptFile = config.loadDefaultScriptFile === true ?
                'application.js' : config.loadDefaultScriptFile;
            $resourceLoader(scriptFile);
        }

        // Pull the response back in from wherever it was before
        this.content = this.response.content;

        // Render the template into the resoponse
        let me = this;
        return new Promise(function(resolve) {

            // $Compile to parse template strings and app.directives
            return $compile(me.template)(

                // In the context of the scope
                me.$scope
            ).then(function(template) {
                resolve(template);
            });
        }).then(function(template) {
            me.response.content = me.content += template;
            me.response.write(me.content);
        });
    }
}
1001847
function(){
    var authsModel;
    this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
    this.mainView = new SwaggerUi.Views.MainView({
      model: this.api,
      el: $('#' + this.dom_id),
      swaggerOptions: this.options,
      router: this
    }).render();
    if (!_.isEmpty(this.api.securityDefinitions)){
      authsModel = _.map(this.api.securityDefinitions, function (auth, name) {
        var result = {};
        result[name] = auth;
        return result;
      });
      this.authView = new SwaggerUi.Views.AuthButtonView({
        data: SwaggerUi.utils.parseSecurityDefinitions(authsModel),
        router: this
      });
      $('#auth_container').append(this.authView.render().el);
    }
    this.showMessage();
    switch (this.options.docExpansion) {
      case 'full':
        this.expandAll(); break;
      case 'list':
        this.listAll(); break;
      default:
        break;
    }
    this.renderGFM();

    if (this.options.onComplete){
      this.options.onComplete(this.api, this);
    }

    setTimeout(Docs.shebang.bind(this), 100);
  }
1360120
public static function load_template_with_dependencies_returns() {
        $resourcestructure = new external_single_structure([
            'component' => new external_value(PARAM_COMPONENT, 'component containing the resource'),
            'name' => new external_value(PARAM_TEXT, 'name of the resource'),
            'value' => new external_value(PARAM_RAW, 'resource value')
        ]);

        return new external_single_structure([
            'templates' => new external_multiple_structure($resourcestructure),
            'strings' => new external_multiple_structure($resourcestructure)
        ]);
    }
722977
function(){
        var deferred = Q.defer();

        fs.readFile( this.path, "utf-8", function( err, data ){
            if( err ){
                deferred.resolve( err );
                return;
            }

            this.parentTemplateId = utils.detectTemplateId( data );
            this.defaultValues = this.pickOutDefaultValues( data );
            this.processor = _.template( this.convertToTemplateFormat( data ) );

            deferred.resolve( this );
        }.bind( this ) );

        return deferred.promise;
    }
1122066
function () {
            this.preload();

            $loadImgPromise.done(function loadImgSuccess(img) {
                if (!imageLoaded) {
                    imageLoaded = true;
                    $img = $(img).appendTo($el);
                }
            });

            $loadImgPromise.fail(function loadImgFail(error) {
                imageLoaded = false;
                if (error) {
                    scope.broadcast('asseterror', error);
                }
            });

            return $loadImgPromise;
        }
951066
function loadTemplates() {
  const templatesPath = path.join(process.cwd(), plugin.config.templatesPath);

  return plugin.myrmex.fire('beforeTemplatesLoad')
  .then(() => {
    // Retrieve paths of all node packages
    return Promise.promisify(fs.readdir)(templatesPath);
  })
  .then(files => {
    // Load all packages configurations
    const templatePromises = [];
    _.forEach(files, (fileName) => {
      const templatePath = path.join(templatesPath, fileName);
      // subdir is the identifier of the template, so we pass it as the second argument
      templatePromises.push(loadTemplate(templatePath, fileName));
    });
    return Promise.all(templatePromises);
  })
  .then(templates => {
    // This event allows to inject code to add or delete or alter node templates configurations
    return plugin.myrmex.fire('afterTemplatesLoad', templates);
  })
  .spread(templates => {
    return Promise.resolve(templates);
  })
  .catch(e => {
    // In case the project does not have any template yet, an exception will be thrown
    // We silently ignore it
    if (e.code === 'ENOENT' && path.basename(e.path) === 'templates') {
      return Promise.resolve([]);
    }
    return Promise.reject(e);
  });
}
217296
function load(file, options) {
	if (options.cache && rr.cache['tpl!' + file]) {
		return Promise.resolve(rr.cache['tpl!' + file]);
	}

	return fs.readFileAsync(file, 'utf8').then(function (template) {
		return utils.wrap(Ractive.parse(template, options), options);
	}).then(function (template) {
		var basePath = path.relative(options.settings.views, path.dirname(file));
		var cOptions = utils.buildOptions(options, null, true);
		cOptions.template = template;

		return Promise.join(utils.buildComponentsRegistry(cOptions), utils.buildPartialsRegistry(basePath, cOptions), function (components, partials) {
			cOptions.components = components;
			cOptions.partials = partials;
			options.components = {};
			options.partials = {};

			var Component = Ractive.extend(cOptions);

			if (options.cache) {
				rr.cache['tpl!' + file] = Component;
			}

			return Component;
		});
	});
}
670912
function template (file, locals) {
	let fullpath = resolve('views', file);
	const [engine, target] = ex2engine(fullpath);
	if (engine !== 'html') {
		return render[engine](target, Object.assign({}, locals, {
			liveReloadHost: process.env.liveReloadHost,
			isDevelopment: configuration.env !== 'production'
		}));
	} else {
		return new Promise(function (resolve, reject) {
			try {
				fs.accessSync(target, fs.constants.R_OK);
				resolve(fs.readFileSync(target, 'utf-8'));
			} catch (err) {
				/* istanbul ignore next */
				reject(err);
			}
		});
	}
}