Merge the local engine helpers with the options helpers.

@param  {Object} `options` Options passed into `render` or `compile`
@return {Object} Options object with merged helpers
777551
function mergeHelpers(engine, options) {
  if (!options || typeof options !== 'object') {
    throw new TypeError('expected an object');
  }

  var opts = extend({}, options);
  var helpers = merge({}, engine.helpers.cache, opts.helpers);
  var keys = Object.keys(helpers);
  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    engine.asyncHelpers.set(key, helpers[key]);
  }

  opts.helpers = engine.asyncHelpers.get({wrap: opts.async});
  return opts;
}
735738
function decorate(engine) {
  // save a reference to original methods
  var renderSync = engine.renderSync;
  var render = engine.render;
  var compile = engine.compile;

  /**
   * Wrapped compile function for all engines loaded onto engine-cache.
   * If possible, compiles the string with the original engine's compile function.
   * Returns a render function that will either use the original engine's compiled function
   * or the `render/renderSync` methods and will resolve async helper ids.
   *
   * ```js
   * var fn = engine.compile('<%= upper(foo) %>', {imports: {'upper': upper}});
   * fn({foo: 'bar'}));
   * //=> BAR
   * ```
   *
   * @param  {String} `str` Original string to compile.
   * @param  {Object} `opts` Options/options to pass to engine's compile function. If a function is passed on `options.mergeFn`, that will be used for merging context before passing it to render.
   * @return {Function} Returns render function to call that takes `locals` and optional `callback` function.
   */

  engine.compile = function engineCompile(str, options) {
    if (typeof str === 'function') {
      return str;
    }

    if (typeof options !== 'undefined' && !isObject(options)) {
      throw new TypeError('expected options to be an object or undefined');
    }

    options = extend({}, options);
    var helpers = mergeHelpers(engine, options);
    var compiled = compile ? compile.call(engine, str, helpers) : null;

    return function(locals, cb) {
      if (typeof locals === 'function') {
        cb = locals;
        locals = {};
      }

      // if compiled already, we can delete helpers and partials from
      // the `helpers` object, since were bound to the context and
      // passed to the engine at compile time
      if (typeof compiled === 'function') {
        str = compiled;
        helpers = {};
      }

      var data = {};
      if (typeof locals === 'string' || Array.isArray(locals)) {
        data = locals;

      } else if (options && typeof options.mergeFn === 'function') {
        data = options.mergeFn(helpers, locals);

      } else {
        data = merge({}, locals, helpers);
      }

      if (typeof cb !== 'function') {
        return renderSync.call(engine, str, data);
      }

      render.call(engine, str, data, function(err, str) {
        if (err) {
          cb(err);
          return;
        }
        engine.asyncHelpers.resolveIds(str, cb);
      });
    };
  };

  /**
   * Wrapped render function for all engines loaded onto engine-cache.
   * Compiles and renders strings with given context.
   *
   * ```js
   *  engine.render('<%= foo %>', {foo: 'bar'}, function(err, content) {
   *    //=> bar
   *  });
   * ```
   *
   * @param  {String|Function} `str` Original string to compile or function to use to render.
   * @param  {Object} `options` Options/locals to pass to compiled function for rendering.
   * @param {Function} `cb` Callback function that returns `err, content`.
   */

  engine.render = function engineRender(str, locals, cb) {
    if (typeof locals === 'function') {
      cb = locals;
      locals = {};
    }

    if (typeof cb !== 'function') {
      throw new TypeError('expected a callback function');
    }

    if (typeof str === 'function') {
      var fn = str;
      fn(locals, cb);
      return;
    }

    if (typeof str !== 'string') {
      cb(new TypeError('expected a string or compiled function'));
      return;
    }

    var async = locals.async;
    locals.async = true;

    // compile the template to create a function
    var render = this.compile(str, locals);

    // call the function to render templates
    render(locals, function(err, content) {
      if (err) {
        cb(err);
        return;
      }
      // reset original `async` value
      locals.async = async;
      cb(null, content);
    });
  };

  /**
   * Wrapped renderSync function for all engines loaded onto engine-cache.
   * Compiles and renders strings with given context.
   *
   * ```js
   * engine.renderSync('<%= foo %>', {foo: 'bar'});
   * //=> bar
   * ```
   *
   * @param  {String|Function} `str` Original string to compile or function to use to render.
   * @param  {Object} `locals` Locals or options to pass to compiled function for rendering.
   * @return {String} Returns rendered content.
   */

  engine.renderSync = function wrappedRenderSync(str, locals) {
    if (typeof str === 'function') {
      return str(locals);
    }

    if (typeof str !== 'string') {
      throw new TypeError('expected a string or compiled function');
    }

    var context = extend({}, locals);
    context.helpers = merge({}, this.helpers, context.helpers);
    return this.compile(str, context)(context);
  };
}
20547
function getOptions(merge) {
	var options = {
		root: null,
		schemas: {},
		add: [],
		formats: {},
		fresh: false,
		multi: false,
		timeout: 5000,
		checkRecursive: false,
		banUnknownProperties: false,
		languages: {},
		language: null
	};
	return copyProps(options, merge);
}
811766
protected function _mergeOptions($options) {
		if (!is_array($options)) {
			$type = $options;
			if (!$type) {
				$type = 'info';
			}
			$options = [
				'type' => $type
			];
		}

		$options += ['type' => 'info'];
		$options += ['element' => $options['type']];

		$options += $this->getConfig();

		list($plugin, $element) = pluginSplit($options['element']);

		if ($plugin) {
			$options['element'] = $plugin . '.Flash/' . $element;
		} else {
			$options['element'] = 'Flash/' . $element;
		}

		return $options;
	}
500276
function(options, data, helpers) {
      if (!helpers) helpers = this._extras;
      if (!data) data = this._data;
      return new EJS(options).render(data, helpers);
    }
997469
function Parser(options) {
  options = options || {};
  this.tokens = [];
  this.token = null;
  this.options = options || defaults;
  this.options.renderer = this.options.renderer || new Renderer;
  this.renderer = this.options.renderer;
  this.renderer.options = this.options;
  this.options.sanitize = false;
  this.renderer.parser = this;
}
192335
function mergeOptions(base, custom) {
  return Object.assign({}, defaultOptions, base, custom, {
    open: Object.assign({}, defaultOptions.open, base.open, custom.open),
    send: Object.assign({}, defaultOptions.send, base.send, custom.send),
  })
}
608961
function renderSync (options) {
  options = new JsdocOptions(options)
  const RenderSync = require('./lib/render-sync')
  const command = new RenderSync(options)
  return command.execute()
}
385303
function( options ){
			if(this.name == getCurrent().name){
				return options.fn(this)
			} else {
				return helpers.ifHasActive.apply(this, arguments);
			}
		}
12033
function createOptions(options) {
    var object = optionsCache[options] = {};(options.match(rnotwhite) || []).forEach(function (flag) {
        object[flag] = true;
    });
    return object;
}
446654
def mix_options(options)
      all_options = @options.merge(options)
      specific_options, plot_options = all_options.partition { |key, _value| specific_option?(key) }
      yield(plot_options, default_options.merge(specific_options))
    end
711890
function compileMesher(options) {
  options = options || {}
  if(!options.order) {
    throw new Error("greedy-mesher: Missing order field")
  }
  if(!options.append) {
    throw new Error("greedy-mesher: Missing append field")
  }
  return generateMesher(
    options.order,
    options.skip,
    options.merge,
    options.append,
    options.extraArgs|0,
    options,
    !!options.useGetter
  )
}
53993
function resolveOptions (options) {
  const {
    versions = undefined, // the versions to build - leave undefined to use the versions from @versionedPage
    filenameModifier = defaultFilenameModifier,
    outputLatest = true
  } = options || {}

  return { versions, filenameModifier, outputLatest }
}
1364101
function mergeOptions (
  parent,
  child,
  vm
) {
  {
    checkComponents(child);
  }

  if (typeof child === 'function') {
    child = child.options;
  }

  normalizeProps(child, vm);
  normalizeInject(child, vm);
  normalizeDirectives(child);

  // Apply extends and mixins on the child options,
  // but only if it is a raw options object that isn't
  // the result of another mergeOptions call.
  // Only merged options has the _base property.
  if (!child._base) {
    if (child.extends) {
      parent = mergeOptions(parent, child.extends, vm);
    }
    if (child.mixins) {
      for (let i = 0, l = child.mixins.length; i < l; i++) {
        parent = mergeOptions(parent, child.mixins[i], vm);
      }
    }
  }

  const options = {};
  let key;
  for (key in parent) {
    mergeField(key);
  }
  for (key in child) {
    if (!hasOwn(parent, key)) {
      mergeField(key);
    }
  }
  function mergeField (key) {
    const strat = strats[key] || defaultStrat;
    options[key] = strat(parent[key], child[key], vm, key);
  }
  return options
}
724705
function mergeOptions(config, pass) {
      var _this = this;

      var result = loadConfig(config);

      var plugins = result.plugins.map(function (descriptor) {
        return loadPluginDescriptor(descriptor);
      });
      var presets = result.presets.map(function (descriptor) {
        return loadPresetDescriptor(descriptor);
      });

      if (config.options.passPerPreset != null && typeof config.options.passPerPreset !== "boolean") {
        throw new Error(".passPerPreset must be a boolean or undefined");
      }
      var passPerPreset = config.options.passPerPreset;
      pass = pass || this.passes[0];

      // resolve presets
      if (presets.length > 0) {
        var presetPasses = null;
        if (passPerPreset) {
          var _passes;

          presetPasses = presets.map(function () {
            return [];
          });
          // The passes are created in the same order as the preset list, but are inserted before any
          // existing additional passes.
          (_passes = this.passes).splice.apply(_passes, [1, 0].concat((0, _toConsumableArray3.default)(presetPasses)));
        }

        presets.forEach(function (presetConfig, i) {
          _this.mergeOptions(presetConfig, presetPasses ? presetPasses[i] : pass);
        });
      }

      // resolve plugins
      if (plugins.length > 0) {
        var _pass;

        (_pass = pass).unshift.apply(_pass, (0, _toConsumableArray3.default)(plugins));
      }

      (0, _merge2.default)(this.options, result.options);
    }
879903
function(options) {
        var params = [],
            opts = options || {},
            transform = 'contrast';

        if (opts.sharpen) {
            params.push('sharpen=' + opts.sharpen);
        }

        if (params.length) {
            transform += ':' + params.join(',');
        }

        return this.append(transform);
    }
331797
function(entities, options) {
      return this.set(entities, langx.mixin({merge: false}, options, addOptions));
    }