CAUTION: 'options' MUST NOT BE OVERWRITTEN! It is binded at the function creation and contains function specificities!
541189
function applyEscape( options , ... args ) {
	var fn , newOptions , wrapOptions ;

	// Cause trouble because the shutting down process itself needs to send escape sequences asynchrnonously
	//if ( options.root.shutdown && ! options.str ) { return options.root ; }

	if ( options.bounded ) { args = options.bounded.concat( args ) ; }

	//console.error( args ) ;
	if ( options.bind ) {
		newOptions = Object.assign( {} , options , { bind: false , bounded: args } ) ;
		fn = applyEscape.bind( this , newOptions ) ;

		// Still a nasty hack...
		Object.setPrototypeOf( fn , Object.getPrototypeOf( options.root ) ) ;   // jshint ignore:line
		fn.apply = Function.prototype.apply ;
		fn.root = options.root ;
		fn.options = newOptions ;

		return fn ;
	}

	var onFormat = [ options.on ] , output , on , off ;
	var action = args[ options.params ] ;

	// If not enough arguments, return right now
	// Well... what about term.up(), term.previousLine(), and so on?
	//if ( arguments.length < 1 + options.params && ( action === null || action === false ) ) { return options.root ; }

	if ( options.params ) {
		onFormat = onFormat.concat( args.slice( 0 , options.params ) ) ;
	}

	//console.log( '\n>>> Action:' , action , '<<<\n' ) ;
	//console.log( 'Attributes:' , attributes ) ;
	if ( action === undefined || action === true ) {
		on = options.onHasFormatting ? options.root.format( ... onFormat ) : options.on ;
		if ( options.str ) { return on ; }
		options.out.write( on ) ;
		return options.root ;
	}

	if ( action === null || action === false ) {
		off = options.offHasFormatting ? options.root.format( options.off ) : options.off ;
		if ( options.str ) { return off ; }
		options.out.write( off ) ;
		return options.root ;
	}

	if ( typeof action !== 'string' ) {
		if ( typeof action.toString === 'function' ) { action = action.toString() ; }
		else { action = '' ; }
	}

	// So we have got a string

	on = options.onHasFormatting ? options.root.format( ... onFormat ) : options.on ;

	if ( options.markupOnly ) {
		action = options.root.markup( ... args.slice( options.params ) ) ;
	}
	else if ( ! options.noFormat ) {
		action = options.root.format( ... args.slice( options.params ) ) ;
	}

	if ( options.wrap ) {
		if ( options.root.wrapOptions.x && options.root.wrapOptions.x > 1 ) {
			wrapOptions = {
				width: options.root.wrapOptions.width || options.root.width - options.root.wrapOptions.x + 1 ,
				glue: '\n' + options.root.str.column( options.root.wrapOptions.x ) ,
				offset: options.root.wrapOptions.offset ,
				updateOffset: true ,
				skipFn: termkit.escapeSequenceSkipFn
			} ;

			action = string.wordwrap( action , wrapOptions ) ;

			if ( ! options.root.wrapOptions.continue ) {
				action = options.root.str.column( options.root.wrapOptions.x ) + action ;
			}

			options.root.wrapOptions.continue = true ;
			options.root.wrapOptions.offset = wrapOptions.offset ;
		}
		else {
			wrapOptions = {
				width: options.root.wrapOptions.width || options.root.width ,
				glue: '\n' ,
				offset: options.root.wrapOptions.offset ,
				updateOffset: true ,
				skipFn: termkit.escapeSequenceSkipFn
			} ;

			action = string.wordwrap( action , wrapOptions ) ;
			options.root.wrapOptions.continue = true ;
			options.root.wrapOptions.offset = wrapOptions.offset ;
		}
	}
	else {
		// All non-wrapped string display reset the offset
		options.root.wrapOptions.continue = false ;
		options.root.wrapOptions.offset = 0 ;
	}

	off = options.offHasFormatting ? options.root.format( options.off ) : options.off ;

	if ( options.forceStyleOnReset ) {
		action = action.replace( new RegExp( string.escape.regExp( options.root.optimized.styleReset ) , 'g' ) , options.root.optimized.styleReset + on ) ;
	}

	if ( options.root.resetString ) {
		output = options.root.resetString + on + action + off + options.root.resetString ;
	}
	else {
		output = on + action + off ;
	}

	// tmp hack?
	if ( options.crlf ) { output = output.replace( /\n/g , '\r\n' ) ; }

	if ( options.str ) { return output ; }

	options.out.write( output ) ;

	return options.root ;
}
1118314
function customize(opts /*: Options */) {
  var renderers = opts.renderers || {};

  return function markings(strings /*: Array<string> */ /*::, ...values: Array<ReactNode> */) {
    var values = Array.prototype.slice.call(arguments, 1);
    var input = stripIndent(strings.join(PLACEHOLDER));
    var parser = new Parser();
    var ast = parser.parse(input);

    if (!validate(ast)) {
      throw new Error('react-markings cannot interpolate React elements non-block positions');
    }

    var index = 0;
    var renderer = new Renderer({
      renderers: Object.assign({}, renderers, {
        Paragraph: function(props) {
          if (props.children.length === 1 && props.children[0] === PLACEHOLDER) {
            var value = values[index];
            index = index + 1 < values.length ? index + 1 : 0;
            return value;
          } else if (renderers.Paragraph) {
            return renderers.Paragraph(props);
          } else if (renderers.paragraph) {
            return renderers.paragraph(props);
          } else {
            return React.createElement('p', {}, props.children);
          }
        },
      })
    });

    return React.createElement('div', {}, renderer.render(ast));
  }
}
785976
function populateOptions(node, values) {
  if (node.tagName !== 'option') {
    for (var i = 0, len = node.children.length; i < len ; i++) {
      populateOptions(node.children[i], values);
    }
    return;
  }
  var value = node.attrs && node.attrs.value;
  value = value || node.props && node.props.value;

  if (!values.hasOwnProperty(value)) {
    return;
  }
  node.attrs = node.attrs || {};
  node.attrs.selected = 'selected';
  node.props = node.props || {};
  node.props.selected = true;
}
606480
def allow_create(function):
    
    @wraps(function)
    def _wrapped_func(*args, **kwargs):
        form = args[0]
        # If this argument is not a form, there are a lot of chances that
        # you didn't decorate the right method.
        # This decorator is only to be used decorating "form_valid()"
        if isinstance(form, (Form, ModelForm)):
            # If the form is not valid, don't try to create new values
            if not form.is_valid():
                return function(*args, **kwargs)

            for k, field in form.fields.items():
                if getattr(field, 'create', False) \
                        and getattr(field, '_new_values', None):
                    new_values = field.create_new_values()
                    # update the field value
                    form.cleaned_data[k] = form.cleaned_data[k] | new_values

        return function(*args, **kwargs)
    return _wrapped_func
1338104
function ImmutableFunction (functionName, functionObj, options) {
    // require options to be an object
    options = requireValidOptionalObject(options)
    // get function definition - append assignment for uglify
    var functionBody = 'var x='+functionObj.toString()
    // throw error if function is native
    if (functionBody.substr(functionBody.length - 17) === '{ [native code] }') {
        throw new Error('function error: cannot wrap native function')
    }
    // use uglify to strip out whitespace and comments but do not modify code
    functionBody = uglifyEs.minify(functionBody, {
        compress: false,
        mangle: false,
    }).code
    // chop off var x= at beginning and ; at end
    functionBody = functionBody.substr(6, functionBody.length-7)
    // create function meta data
    var functionMeta = {
        functionBody: functionBody,
        functionName: functionName,
        functionId: stableId(functionBody),
        logClient: options.logClient,
    }
    // create wrapper function that will do logging and call original
    var functionWrapperFunction = function functionWrapperFunction () {
        // call original function - catching errors for logging
        try {
            var res = functionObj.apply(this, arguments)
        }
        catch (error) {
            var err = error
        }
        // if log client then do logging
        if (options.logClient) {
            // get number of arguments
            var argsLength = arguments.length
            // copy of arguments
            var args = []
            // create copy of arguments
            for (var i=0; i < argsLength; i++) {
                args[i] = arguments[i]
            }
            // log call
            options.logClient.log('functionCall', {
                functionName: functionName,
                args: args,
                res: err || res,
                isError: (err ? true : false),
                moduleCallId: (this ? this.moduleCallId : undefined),
                requestId: (this ? this.requestId : undefined),
            })
        }
        // if result was an error then throw original error
        if (err) {
            throw err
        }
        // otherwise return original result
        else {
            return res
        }
    }
    // attach meta data to function
    functionWrapperFunction.meta = functionMeta
    // return wrapper function
    return functionWrapperFunction
}
403806
function prepareOptions(options) {
    if (typeof options === "string") {
        options = { path: options };
    }

    Ul.merge(options, {
        flags: "a"
    });

    this.options = options;
}
1226807
function (options) {
  const defaults = {
    name: null,
    max: null,
    precision: 2,
    steps: false
  };
  for (var attrname in defaults) {
    this[attrname] = options.hasOwnProperty(attrname) && options[attrname] !== null ? options[attrname] : defaults[attrname];
  }
  if(options.custom) this.custom = options.custom.bind(this);
  this.val = options.count || 0;
}
934128
function validate ( inputOptions ) {

		var i, optionName, optionValue,
			filteredOptions = {};

		for ( i = 0; i < FormatOptions.length; i+=1 ) {

			optionName = FormatOptions[i];
			optionValue = inputOptions[optionName];

			if ( optionValue === undefined ) {

				// Only default if negativeBefore isn't set.
				if ( optionName === 'negative' && !filteredOptions.negativeBefore ) {
					filteredOptions[optionName] = '-';
				// Don't set a default for mark when 'thousand' is set.
				} else if ( optionName === 'mark' && filteredOptions.thousand !== '.' ) {
					filteredOptions[optionName] = '.';
				} else {
					filteredOptions[optionName] = false;
				}

			// Floating points in JS are stable up to 7 decimals.
			} else if ( optionName === 'decimals' ) {
				if ( optionValue >= 0 && optionValue < 8 ) {
					filteredOptions[optionName] = optionValue;
				} else {
					throw new Error(optionName);
				}

			// These options, when provided, must be functions.
			} else if ( optionName === 'encoder' || optionName === 'decoder' || optionName === 'edit' || optionName === 'undo' ) {
				if ( typeof optionValue === 'function' ) {
					filteredOptions[optionName] = optionValue;
				} else {
					throw new Error(optionName);
				}

			// Other options are strings.
			} else {

				if ( typeof optionValue === 'string' ) {
					filteredOptions[optionName] = optionValue;
				} else {
					throw new Error(optionName);
				}
			}
		}

		// Some values can't be extracted from a
		// string if certain combinations are present.
		throwEqualError(filteredOptions, 'mark', 'thousand');
		throwEqualError(filteredOptions, 'prefix', 'negative');
		throwEqualError(filteredOptions, 'prefix', 'negativeBefore');

		return filteredOptions;
	}
207711
function option(name, type) {
  if (name[TYPICAL_TYPE]) {
    type = name;
    name = `${type.name}Option`;
  }

  /* istanbul ignore else */
  if (__DEV__) {
    assert(typeof name === 'string', `option()'s name must be a string`);
    assert(type[TYPICAL_TYPE], `option()'s type must be a type`);
  }

  const api = this;

  function Option(value, context) {
    if (Context.isRequired(context)) {
      return Context.with(value, Option, context, api);
    }

    return value == null ? context.toValue(value) : type(value, context);
  }

  return decorate(Option, name, option, type);
}
535602
private static void rewriteOptions(String[] args, String option, String new_option) {
        for (int i=0; i<args.length; ++i) {
            if (args[i].equals(option)) {
                args[i] = new_option;
            }
        }
    }
23276
function findFunctions(optionFunctions, defaultDir) {
  var allFunctions = [];
  optionFunctions = toArray(optionFunctions);
  optionFunctions.forEach(function (fn, i) {
    if (typeof fn === 'function') {
      allFunctions.push(fn);
      return;
    }
    if (typeof fn !== 'string') {
      throw new Error('function must be a string or array');
    }
    var m = requireMaybe(fn);
    if (!m) {
      m = requireMaybe(path.join(process.cwd(), fn));
    }
    if (!m) {
      m = requireMaybe(path.join('..', defaultDir, fn));
    }
    if (!m) {
      throw new Error('did not find function or problem loading function: ' + fn);
    }
    if (typeof m !== 'function') {
      throw new Error('function module must export a function');
    }
    allFunctions.push(m);
  });
  return allFunctions;
}
985192
function parseOptions(options) {
    let functions = true;
    let classes = true;
    let variables = true;
    let typedefs = true;

    if (typeof options === "string") {
        functions = options !== "nofunc";
    } else if (typeof options === "object" && options !== null) {
        functions = options.functions !== false;
        classes = options.classes !== false;
        variables = options.variables !== false;
        typedefs = options.typedefs !== false;
    }

    return { functions, classes, variables, typedefs };
}
980400
function bind(f) {
    function curriedBind(o) {
        /* If native bind doesn't exist, use a polyfill. */
        var args = [].slice.call(arguments, 1),
            g;

        if(f.bind) g = f.bind.apply(f, [o].concat(args));
        else {
            g = function() {
                return f.apply(o, args.concat(rest(arguments)));
            };
        }

        /*
           Let's try and associate all curried functions with the same name as the originator.
           Can't override length but can set _length for currying
        */
        g._name = functionName(f);
        g._length = Math.max(functionLength(f) - args.length, 0);

        return g;
    }

    /* Manual currying since `curry` relies in bind. */
    if(arguments.length > 1) return curriedBind.apply(this, [].slice.call(arguments, 1));
    else return curriedBind;
}
278993
function configureESLint(options) {
	const ESLintConfig = {
		rules: options.rules
	}

	ESLintConfig.extends = 'xo'
	if (options.esnext) {
		ESLintConfig.extends = 'xo/esnext'
	}

	if (!options.semicolon) {
		ESLintConfig.rules.semi = [2, 'never']
	}

	if (options.space === false) {
		ESLintConfig.rules.indent = [
			2, 'tab', {
				SwitchCase: 1
			}
		]
	} else {
		ESLintConfig.rules.indent = [
			2, parseInt(options.space, 10), {
				SwitchCase: 0
			}
		]
	}

	ESLintConfig.rules['valid-jsdoc'] = [0]
	ESLintConfig.rules['require-jsdoc'] = [0]

	console.debug(stripIndent`
		${clr.title}ESlint Options${clr.title.out}:
	`)
	if (console.canWrite(5)) {
		console.pretty(ESLintConfig, 2)
	}

	return () => new ESLint({
		baseConfig: ESLintConfig,
		fix: true,
		rules: options.rules
	})
}
527755
function setSelectedOption(optionValue) {
    const optionFind = (option) => option.value.toString() === optionValue.toString();
    const newOptionSelected = find(this.state.options, optionFind);
    const newOptionSelectedValue = newOptionSelected && newOptionSelected.value;
    let options = this.state.options;

    options = options.map((option, i) => {
        if (option.value === newOptionSelectedValue) {
            option.selected = true;
            this.setState('selectedIndex', i);
            this.setState('value', option.value);
        } else {
            option.selected = false;
        }
        return option;
    });
    this.setState('options', options);
    this.update();
}
1294504
function do_conform(args, opts) {
	function prettify(e) {
		var msg = ""+e;
		if(e.fileName) {
			msg += " [" + e.fileName;
			if(e.lineNumber) {
				msg += ":" + e.lineNumber;
			}
			msg += "]";
		}
		if (e.stack) {
			msg += '\n====== stack ======\n';
			msg += e.stack + "\n";
		}
		return msg;
	}
	var arg, fn, validate, opts_max_length, defaults_direction;
	try {
		args = Array.prototype.slice.call(args);

		opts = opts || {};
		validate = opts.validate || [];
		opts_max_length = opts.max || args.length;
		defaults_direction = opts.defaults || 'left';
		
		opts.type = opts.type || 'basic';
		
		if(opts.length) {
			opts.min = opts.length;
			opts.max = opts.length;
		}

		if(!opts.min) {
			opts.min = 0;
		}
		
		// First priority to search for the callback function
		if(opts.type === 'async') {
			(function(){
				if(args.length < 1) {
					return;
				}
				var i = args.length - 1;
				for(; i >= 0; i -= 1) {
					if(!mod.isFunction(args[i])) {
						//throw new TypeError("Last argument is not valid function!");
						return;
					}
					fn = args[i];
					return;
				}
			}());
		}
		
		// Pad args from left (with undefined) if the direction to set defaults is from right
		if( opts.max && (defaults_direction === 'right') ) {
			while(args.length < opts.max) {
				args.unshift(undefined);
			}
		}
		
		// Create default error handler if fn is undefined
		if( (opts.type === 'async') && (!mod.isFunction(fn)) ) {
			throw new TypeError("No callback function");
		}
		
		// Check states

		/*
		if(args.length < 1) {
			throw new TypeError("No callback function found!");
		}
		*/
		
		if(opts.min && (args.length < opts.min) ) {
			throw new TypeError("Not enough arguments!");
		}
		
		if(opts.max && (args.length > opts.max) ) {
			throw new TypeError("Too many arguments!");
		}
		
		// Check validate
		if(!(validate instanceof Array)) {
			throw new TypeError("opts.validate must be an Array!");
		} else if(validate.length !== 0) {
			(function(){
				var i = 0;
				
				function do_loop(){
					var result, msgs = [];
					result = mod.validate(args[i], validate[i]);
					if(!result.valid) {
						foreach(result.errors).each(function(p) {
							msgs.push( ((p.property !== undefined) ? 'property="' + p.property : '') + '", ' + p.message );
						});
						throw new TypeError("Argument #" + i + " was invalid: " + msgs.join('; ') + " (schema was " + debug_stringify(validate[i]) + ")");
					}
				}
				
				// Check args with each schema from validate
				for(; i < validate.length; i += 1) {
					do_loop();
				}
			}());
		}
		
		return args;
	} catch(e) {
		if(mod.isFunction(fn)) {
			fn(prettify(e));
		} else {
			throw e;
		}
	}
}
152097
function createOptions( options ) {
	var object = optionsCache[ options ] = {};
	jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
		object[ flag ] = true;
	});
	return object;
}