helpers //////////////////
767257
function indexOf(nodeList, el) {
  return Array.prototype.slice.call(nodeList).indexOf(el);
}
1329292
function helpDefine(_api, _name, _fun) {
      var api = APIS[_api];

      Utils.assert(!!api, 'Invalid api name $1', _api);

      if(_name) {
        api[_name] = Utils.override(api[_name], _fun);
      } else {
        Utils.extendOverriden(api, _fun);
      }
    }
554014
function(){
			var helpersToCall = [].slice.call(arguments, 0, arguments.length - 2).map(function(name){
				return Handlebars.helpers[name];
			}),
				value = arguments[arguments.length - 2] || "";
				
			helpersToCall.forEach(function(helper){
				value = helper.call(Handlebars, value);
			});
			
			return value;
		}
751935
function helpPlugin() {
  return function(app) {

    // style to turn `[ ]` strings into
    // colored strings with backticks
    app.style('codify', function(msg) {
      var re = /\[([^\]]*\[?[^\]]*\]?[^[]*)\]/g;
      return msg.replace(re, function(str, code) {
        return this.red('`' + code + '`');
      }.bind(this));
    });

    // style and format a single help command
    app.style('helpCommand', function(command) {
      var msg = '';
      msg += this.bold(command.name.substr(0, 1).toUpperCase() +
                       command.name.substr(1) + ': ');
      msg += this.bold(command.description);
      return msg;
    });

    // style and format an array of help commands
    app.style('helpCommands', function(commands) {
      return commands
        .map(this.helpCommand)
        .join('\n\n');
    });

    // style and format a single example
    app.style('helpExample', function(example) {
      var msg = '';
      msg += ' ' + this.gray('# ' + example.description) + '\n';
      msg += ' ' + this.white('$ ' + example.command);
      return msg;
    });

    // style and format an array of examples
    app.style('helpExamples', function(examples) {
      return examples
        .map(this.helpExample)
        .join('\n\n');
    });

    // style and format a single option
    app.style('helpOption', function(option) {
      var msg = '';
      msg += ' ' + (option.flag ? this.bold(option.flag) : '  ');
      msg += ' ' + this.bold(option.name);
      msg += ' ' + this.bold(this.codify(option.description));
      return msg;
    });

    // style and format an array of options
    app.style('helpOptions', function(options) {
      return options
        .map(this.helpOption)
        .join('\n');
    });

    // style and formation a help text object using
    // other styles to break up responibilities
    app.emitter('help', function(help) {
      var msg = '\n';
      msg += this.bold('Usage: ') + this.cyan(help.usage) + '\n\n';
      msg += this.helpCommands(help.commands);

      if (help.examples && help.examples.length) {
        msg += this.bold('Examples:\n\n');
        msg += this.helpExamples(help.examples);
      }

      if (help.options && help.options.length) {
        msg += this.bold('Options:\n\n');
        msg += this.helpOptions(help.options);
      }
      return msg + '\n';
    });
  };
}
354086
function helperWrapper (fn, args) {
    var _this = this
    var options = args[args.length - 1]
    var hash = options.hash

    // "fn" and "inverse" return strings. They must be able to handle promises
    // just as the compiled template and partials
    options.fn = options.fn && wrap(options.fn, prepareAndResolveMarkers)
    options.inverse = options.inverse && wrap(options.inverse, prepareAndResolveMarkers)

    // If there are any promises in the helper args or in the hash,
    // the evaluation of the helper cannot start before these promises are resolved.
    var promisesInArgs = anyApplies(args, isPromiseAlike)
    var promisesInHash = anyApplies(values(hash), isPromiseAlike)

    if (!promisesInArgs && !promisesInHash) {
      // No promises in hash or args. Act a normal as possible.
      var result = fn.apply(_this, args)
      return isPromiseAlike(result) ? markers.asMarker(result) : result
    }

    var promise = deep(args).then(function (resolvedArgs) {
      // We need "markers", because we are in a new event-loop-cycle now.
      return prepareAndResolveMarkers(function () {
        return fn.apply(_this, resolvedArgs)
      })
    })
    return markers.asMarker(promise)
  }
1258561
function tpl_apply_with_register_helper(Handlebars, template_path, data_obj, dest_file_path) {
	var rs = fs.createReadStream(template_path, {bufferSize: 11}); 
	var bufferHelper = new BufferHelper();

	rs.on("data", function (trunk){
			bufferHelper.concat(trunk);
	});

	rs.on("end", function () {
		var source = bufferHelper.toBuffer().toString('utf8');
		var template = Handlebars.compile(source);
	
    // log(template);
		
		var content = template(data_obj);

		fs.writeFile(dest_file_path, content , function (err) {
		  if (err) throw err;
		  log('It\'s saved!');
		});

	});
}
135879
function() {
      this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';

      var params = ["depth0"];
      this.setupParams(0, params);

      var current = this.topStack();
      params.splice(1, 0, current);

      this.source.push("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
    }
150618
function isHelper(node) {
  if (t.isMemberExpression(node)) {
    return isHelper(node.object) || isHelper(node.property);
  } else if (t.isIdentifier(node)) {
    return node.name === "require" || node.name[0] === "_";
  } else if (t.isCallExpression(node)) {
    return isHelper(node.callee);
  } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
    return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
  } else {
    return false;
  }
}
968767
public void help() {
        final HelpFormatter formatter = new HelpFormatter();
        final String helpString = getHelpString();
        formatter.printHelp(80,
            helpString,
            "options:",
            getOptions(),
                "[RUNDECK version " + VersionConstants.VERSION + " (" + VersionConstants.BUILD + ")]");
    }
316036
function getHelpListData(commandsData, context) {
  commandsData.commands.forEach(addParamGroups);

  var heading;
  if (commandsData.commands.length === 0) {
    heading = l10n.lookupFormat('helpListNone', [ commandsData.prefix ]);
  }
  else if (commandsData.prefix == null) {
    heading = l10n.lookup('helpListAll');
  }
  else {
    heading = l10n.lookupFormat('helpListPrefix', [ commandsData.prefix ]);
  }

  return {
    l10n: l10n.propertyLookup,
    includeIntro: commandsData.prefix == null,
    heading: heading,
    onclick: context.update,
    ondblclick: context.updateExec,
    matchingCommands: commandsData.commands
  };
}
924526
function makeHelper(obj, verb) {
  obj[verb] = function helper(url, options, f) {
    // ('url')
    if(_.isString(url)){
      // ('url', f)
      if(_.isFunction(options)){
        f = options;
      }

      if(!_.isObject(options)){
        options = {};
      }

      // ('url', {object})
      options.url = url;
    }

    if(_.isObject(url)){
      if(_.isFunction(options)){
        f = options;
      }
      options = url;
    }

    options.method = verb.toUpperCase();
    return obj(options, f);
  };
}
1194546
function(key, ctx, partials, returnFound) {
      var found,
          names = key.split('.'),
          val = this.f(names[0], ctx, partials, returnFound),
          doModelGet = this.options.modelGet,
          cx = null;

      if (key === '.' && isArray(ctx[ctx.length - 2])) {
        val = ctx[ctx.length - 1];
      } else {
        for (var i = 1; i < names.length; i++) {
          found = findInScope(names[i], val, doModelGet);
          if (found != null) {
            cx = val;
            val = found;
          } else {
            val = '';
          }
        }
      }

      if (returnFound && !val) {
        return false;
      }

      if (!returnFound && typeof val == 'function') {
        ctx.push(cx);
        val = this.mv(val, ctx, partials);
        ctx.pop();
      }

      return val;
    }
986011
function() {
			var lines = this._options.callbacks.beforeBody.apply(this, arguments);
			return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];
		}
453348
function registerHelpers(helpers) {
    var s = this;
    var names = Object.keys(helpers || {});

    for (var i = 0, len = names.length; i < len; i++) {
      var name = names[i];
      s.registerHelper(name, helpers[name]);
    }

    return s;
  }
435873
def set_helper(self, helper):
        
        # We don't want to "unset" in this method.
        if helper is None:
            return

        # Get the right kind of helper if given a DockerHelper
        if isinstance(helper, DockerHelper):
            helper = helper._helper_for_model(self.__model_type__)

        # We already have this one.
        if helper is self._helper:
            return
        if self._helper is None:
            self._helper = helper
        else:
            raise RuntimeError('Cannot replace existing helper.')
1348728
function getHelpBlock(opts) {
  return {
    tag: 'span',
    attrs: {
      className: {
        'help-block': true,
        'error-block': opts.hasError
      },
      // aria support
      id: opts.id,
      role: 'tooltip'
    },
    children: opts.help
  };
}
173762
function(helperName, paramSize, params, useRegister) {
                var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params));

                if (useRegister) {
                    this.useRegister('options');
                    params.push('options');
                    return 'options=' + options;
                } else {
                    params.push(options);
                    return '';
                }
            }