Helpers //////////////////////////////////////////////////////////////////////
496579
protected int resolveNrOfInstances(ActivityExecution execution) {
    int nrOfInstances = -1;
    if (loopCardinalityExpression != null) {
      nrOfInstances = resolveLoopCardinality(execution);
    } else if (collectionExpression != null) {
      Object obj = collectionExpression.getValue(execution);
      if (!(obj instanceof Collection)) {
        throw LOG.unresolvableExpressionException(collectionExpression.getExpressionText(), "Collection");
      }
      nrOfInstances = ((Collection<?>) obj).size();
    } else if (collectionVariable != null) {
      Object obj = execution.getVariable(collectionVariable);
      if (!(obj instanceof Collection)) {
        throw LOG.invalidVariableTypeException(collectionVariable, "Collection");
      }
      nrOfInstances = ((Collection<?>) obj).size();
    } else {
      throw LOG.resolveCollectionExpressionOrVariableReferenceException();
    }
    return nrOfInstances;
  }
933298
public function helpers()
    {
        if ($this->_helpers === null) {
            $this->_helpers = new HelperRegistry($this);
        }

        return $this->_helpers;
    }
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(", ") + "); }");
    }
1367408
function parseGoogleNewsRSSParamsErrorHelper(errorMessage) {
    return {error: true
        , errorMessage: errorMessage
        , type: null 
        , terms: null
        , url: null
        };
}
1162670
function help (options) {
    const { cmds, desc } = options
    let commands = [
        '',
        'Commands:',
        ''
    ]
    
    cmds.forEach(function (v) {
        let item = pad(v.command + (v.aliases ? '|' + v.aliases : '')) + v.desc
        commands.push(item.replace(/^/gm, '    '))
    })
    
    const optionsList = [
        '',
        'Options:',
        '',
        (pad('-h, --help') + 'output usage information').replace(/^/gm, '    '),
        (pad('-v, --version') + 'output the version number').replace(/^/gm, '    '),
        '',
        ''
    ]
    
    process.stdout.write(['', desc].concat(commands, optionsList).join('\n'))
    process.exit()
}
639580
function inspectHelpers(settings, opts) {
  var helpers = Object.keys(settings.imports);
  for (var key in opts) {
    if (helpers.indexOf(key) !== -1) {
      conflictMessage(settings, opts, key);
    }
  }
}
1059482
function printHelp(argv) {
    if (argv.help || argv.h) {
        showHelpInfo();
        process.exit(0);
    }

    // soi --version
    if (argv.version || argv.v) {
        console.log(`soi version: ${pkgInfo.version}`);
        process.exit(0);
    }
}
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
  };
}
127023
def help(self):
        ''''''
        cmds = self.get_exposed_cmds()
        t = text_helper.Table(fields=['command', 'doc'],
                              lengths=[50, 85])
        return t.render((reflect.formatted_function_name(x), x.__doc__, )
                        for x in cmds.values())
12708
def method_missing(name, *args, &block)
      helpers.key?(name) ? helpers.fetch(name).call : super
    end
1242620
function selector() {
        whitespace();

        while (css[0] === '}') {
            error('extra closing bracket');
        }

        const m = match(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);

        if (m) {
            return m[0]
                .trim() // remove all comments from selectors
                .replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '')
                .replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function(m) {
                    return m.replace(/,/g, '\u200C');
                })
                .split(/\s*(?![^(]*\)),\s*/)
                .map(function(s) {
                    return s.replace(/\u200C/g, ',');
                });
        }
    }
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)
  }
}
869043
function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
  if (localBindings && !id) {
    throw new Error("Unexpected local bindings for module-based helpers.");
  }

  if (!id) return;

  const {
    localBindingNames,
    dependencies,
    exportBindingAssignments,
    exportPath,
    exportName,
    importBindingsReferences,
    importPaths,
  } = metadata;

  const dependenciesRefs = {};
  dependencies.forEach((name, id) => {
    dependenciesRefs[id.name] =
      (typeof getDependency === "function" && getDependency(name)) || id;
  });

  const toRename = {};
  const bindings = new Set(localBindings || []);
  localBindingNames.forEach(name => {
    let newName = name;
    while (bindings.has(newName)) newName = "_" + newName;

    if (newName !== name) toRename[name] = newName;
  });

  if (id.type === "Identifier" && exportName !== id.name) {
    toRename[exportName] = id.name;
  }

  traverse(file, {
    Program(path) {
      // We need to compute these in advance because removing nodes would
      // invalidate the paths.
      const exp = path.get(exportPath);
      const imps = importPaths.map(p => path.get(p));
      const impsBindingRefs = importBindingsReferences.map(p => path.get(p));

      const decl = exp.get("declaration");
      if (id.type === "Identifier") {
        if (decl.isFunctionDeclaration()) {
          exp.replaceWith(decl);
        } else {
          exp.replaceWith(
            t.variableDeclaration("var", [t.variableDeclarator(id, decl.node)]),
          );
        }
      } else if (id.type === "MemberExpression") {
        if (decl.isFunctionDeclaration()) {
          exportBindingAssignments.forEach(assignPath => {
            const assign = path.get(assignPath);
            assign.replaceWith(t.assignmentExpression("=", id, assign.node));
          });
          exp.replaceWith(decl);
          path.pushContainer(
            "body",
            t.expressionStatement(
              t.assignmentExpression("=", id, t.identifier(exportName)),
            ),
          );
        } else {
          exp.replaceWith(
            t.expressionStatement(t.assignmentExpression("=", id, decl.node)),
          );
        }
      } else {
        throw new Error("Unexpected helper format.");
      }

      Object.keys(toRename).forEach(name => {
        path.scope.rename(name, toRename[name]);
      });

      for (const path of imps) path.remove();
      for (const path of impsBindingRefs) {
        const node = t.cloneNode(dependenciesRefs[path.node.name]);
        path.replaceWith(node);
      }

      // We only use "traverse" for all the handy scoping helpers, so we can stop immediately without
      // actually doing the traversal.
      path.stop();
    },
  });
}
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
  };
}
585551
@Deprecated
	protected Map<String, Helper> helpers() {
		Map<String, Helper> helpers = new HashMap<>();
		helpers.put(HandlebarsJsonPathHelper.NAME, new HandlebarsJsonPathHelper());
		helpers.put(HandlebarsEscapeHelper.NAME, new HandlebarsEscapeHelper());
		return helpers;
	}
335542
private Map<String, ParseTreeNode> getHelperTokens() throws TreeException {
	Map<String, ParseTreeNode> helpers = new HashMap<String, ParseTreeNode>();
	ParseTreeNode helperTree = parserTree.getChild("Helper");
	ParseTreeNode helperDefinitions = helperTree.getChild("HelperDefinitions");
	for (ParseTreeNode helperDefinition : helperDefinitions
		.getChildren("HelperDefinition")) {
	    String identifier = helperDefinition.getChild("IDENTIFIER")
		    .getText();
	    helpers.put(identifier, helperDefinition);
	}
	return helpers;
    }
1161472
function helpConsole() {
    /* eslint-disable no-console */
    console.log('  Examples:');
    console.log('');
    console.log('    $ renovate --token abc123 singapore/lint-condo');
    console.log(
      '    $ renovate --labels=renovate,dependency --ignore-unstable=false --log-level debug singapore/lint-condo'
    );
    console.log('    $ renovate singapore/lint-condo singapore/package-test');
    /* eslint-enable no-console */
  }