@function strictArgs

get/set the default value for strict args

@param {boolean} strictArgs

@returns {ImmutableCore|boolean}
173094
function strictArgs (strictArgs) {
    // set default if value passed
    if (defined(strictArgs)) {
        immutable.defaultStrictArgs = strictArgs ? true : false
        // return immutable
        return ImmutableCore
    }
    // return default value
    return immutable.defaultStrictArgs
}
1267984
function normalizeArgs(id){
  var keys = id.keys;
  var pairs = {};

  Object.keys(id.keys).forEach(function forEachCSID(csid){
    var pair = pairs[csid] = {};
    // flexible buffer or base32 input
    pair.key = Buffer.isBuffer(id.keys[csid]) ? id.keys[csid]
             : base32.decode(id.keys[csid]);

    pair.secret = Buffer.isBuffer(id.secrets[csid]) ? id.secrets[csid]
                : base32.decode(id.secrets[csid]);
  });
  return {pairs: pairs, debug: log.debug};
}
257686
function _unquoteArgs(args) {
    for (var i = 0; i < args.length; i++) {
        if (_isQuoted(args[i])) args[i] = _unquote(args[i]);
    }
}
883645
function getArgs(userArgs, defaultArgs, userCallback) {
  let args = { };
  let callback = userCallback || function() { };
  defaultArgs.unshift(args);
  _.assign.apply(null, defaultArgs);

  if (_.isPlainObject(userArgs)) {
    _.merge(args, userArgs);
  } else {
    callback = userArgs;
  }

  return {
    options: args,
    callback,
  };
}
523863
function filterArguments(args, params, inject) {

	var newArgs = ['node', '_mocha'].concat(inject || []),
		param, i, len,
		type;

	for (i = 2, len = args.length; i < len; i++) {

		if ((i < args.length - 1) && (args[i].length > 2) && (args[i].substr(0, 2) === '--')) {

			// Get parameter without '--'
			param = args[i].substr(2);

			// Is parameter used?
			if (params.hasOwnProperty(param)) {

				// Remember what the type was
				type = typeof params[param];

				// Overwrite value with next value in arguments
				if (type === 'boolean') {
					params[param] = true;

				} else {
					params[param] = args[i + 1];
					i++;

					// Convert back to boolean if needed
					if (type === 'number') {
						params[param] = parseFloat(params[param]);
					}
				}

			} else {
				newArgs.push(args[i]);
			}
		} else {
			newArgs.push(args[i]);
		}
	}

	// Set test-path with last argument if none given
	if (!params['test-path']) {
		params['test-path'] = args.pop();
	}

	newArgs.push(path.join(__dirname, '..', 'resource', 'run.js'));

	return newArgs;
}
435862
def strict_defaults(fn):
    '''  '''
    @wraps(fn)
    def wrapper(*args, **kwargs):
        defaults = _get_default_args(fn)
        # dictionary that holds each default type
        needed_types={
            key:type(defaults[key]) for key in defaults
        }
        # ordered tuple of the function's argument names
        arg_names=_get_arg_names(fn)
        assert not len(arg_names) - len(fn.__defaults__), '{} needs default variables on all arguments'.format(fn.__name__)
        # merge args to kwargs for easy parsing
        for i in range(len(args)):
            if args[i] not in kwargs.keys():
                kwargs[arg_names[i]]=args[i]
        # assert that theyre all the correct type
        for name in needed_types:
            # do them all seperately so you can show what went wrong
            assert  isinstance(kwargs[name],needed_types[name]), 'got {} and expected a {}'.format(kwargs[name],needed_types[name])
        # return the refined results
        return fn(**kwargs)
    return wrapper
319194
function TypedBoolean (config) {
    const boolean = this;

    // define properties
    Object.defineProperties(boolean, {

        strict: {
            /**
             * @property
             * @name TypedBoolean#strict
             * @type {boolean}
             */
            value: config.hasOwnProperty('strict') ? !!config.strict : false,
            writable: false
        }

    });

    return boolean;
}
1292056
function UIArgument(uiArgumentShorthand, localVars)
{
    /**
     * @param uiArgumentShorthand
     *
     * @throws  UIArgumentException
     */
    this.validate = function(uiArgumentShorthand)
    {
        var msg = "UIArgument validation error:\n"
            + print_r(uiArgumentShorthand);
        
        // try really hard to throw an exception!
        if (!uiArgumentShorthand.name) {
            throw new UIArgumentException(msg + 'no name specified!');
        }
        if (!uiArgumentShorthand.description) {
            throw new UIArgumentException(msg + 'no description specified!');
        }
        if (!uiArgumentShorthand.defaultValues &&
            !uiArgumentShorthand.getDefaultValues) {
            throw new UIArgumentException(msg + 'no default values specified!');
        }
    };
    
    
    
    /**
     * @param uiArgumentShorthand
     * @param localVars            a list of local variables
     */
    this.init = function(uiArgumentShorthand, localVars)
    {
        this.validate(uiArgumentShorthand);
        
        this.name = uiArgumentShorthand.name;
        this.description = uiArgumentShorthand.description;
        this.required = uiArgumentShorthand.required || false;
        
        if (uiArgumentShorthand.defaultValues) {
            var defaultValues = uiArgumentShorthand.defaultValues;
            this.getDefaultValues =
                function() { return defaultValues; }
        }
        else {
            this.getDefaultValues = uiArgumentShorthand.getDefaultValues;
        }
        
        for (var name in localVars) {
            this[name] = localVars[name];
        }
    }
    
    
    
    this.init(uiArgumentShorthand, localVars);
}
952268
function prepareArgs(opts) {
  var valueFromOpts = valueFrom.bind(null, opts);

  return Object.keys(opts).reduce(function(acc, item) {
    acc.splice(indexFromArgs(item), 0, valueFromOpts(item));

    return acc;
  }, []);
}
372520
function(fun /*, defaults */) {
      var defaults = _.rest(arguments);

      return function(/*args*/) {
        var args = _.toArray(arguments);
        var sz = _.size(defaults);

        for(var i = 0; i < sz; i++) {
          if (!existy(args[i]))
            args[i] = defaults[i];
        }

        return fun.apply(this, args);
      };
    }
34819
function splitArgs(str) {
  const out = [];

  let inString = false;
  let currentArg = '';

  for (let index = 0; index < str.length; index += 1) {
    const c = str[index];
    if (c === ',' && !inString) {
      out.push(currentArg.trim());
      currentArg = '';
    } else if (currentArg.length === 0 && c === '"' && !inString) {
      currentArg += c;
      inString = true;
    } else if (inString && c === '"' && str[index - 1] !== '\\') {
      currentArg += c;
      inString = false;
    } else if (!(c === ' ' && currentArg.length === 0)) {
      currentArg += c;
    }
  }
  out.push(currentArg.trim());

  return out;
}
992712
function (scope, iAttrs, newValue) {
    'use strict';
    var ngModelArr = iAttrs.ngModel.split('.');
    // console.log(JSON.stringify(ngModelArr, null, 2));


    switch (ngModelArr.length) {
    case 1:
        scope.$apply(function () {scope[ngModelArr[0]] = newValue;});
        break;
    case 2:
        scope.$apply(function () {scope[ngModelArr[0]][ngModelArr[1]] = newValue;});
        break;
    case 3:
        scope.$apply(function () {scope[ngModelArr[0]][ngModelArr[1]][ngModelArr[2]] = newValue;});
        break;
    case 4:
        scope.$apply(function () {scope[ngModelArr[0]][ngModelArr[1]][ngModelArr[2]][ngModelArr[3]] = newValue;});
        break;
    case 5:
        scope.$apply(function () {scope[ngModelArr[0]][ngModelArr[1]][ngModelArr[2]][ngModelArr[3]][ngModelArr[4]] = newValue;});
        break;
    default:
        scope.$apply(function () {scope[iAttrs.ngModel] = newValue;});
    }

}
1160883
function baseFlatten(input, shallow, strict, output) {
  output = output || [];
  var idx = output.length;
  for (var i = 0, length = getLength(input); i < length; i++) {
    var value = input[i];
    if (isArrayLike(value) && (isArray(value) || isArguments(value))) {
      // flatten current level of array or arguments object
      if (shallow) {
        var j = 0,
          len = value.length;
        while (j < len) {
          output[idx++] = value[j++];
        }
      } else {
        baseFlatten(value, shallow, strict, output);
        idx = output.length;
      }
    } else if (!strict) {
      output[idx++] = value;
    }
  }

  return output;
}
957376
function parseArgs () {
  // Configure the argument parser
  yargs
    .option("schema", {
      type: "boolean",
      default: true,
    })
    .option("spec", {
      type: "boolean",
      default: true,
    })
    .option("o", {
      alias: "outfile",
      type: "string",
      normalize: true,
    })
    .option("r", {
      alias: "dereference",
      type: "boolean",
    })
    .option("t", {
      alias: "type",
      type: "string",
      normalize: true,
      default: "json",
    })
    .option("f", {
      alias: "format",
      type: "number",
      default: 2,
    })
    .option("w", {
      alias: "wrap",
      type: "number",
      default: Infinity,
    })
    .option("d", {
      alias: "debug",
      type: "boolean",
    })
    .option("h", {
      alias: "help",
      type: "boolean",
    });

  // Show the version number on "--version" or "-v"
  yargs
    .version()
    .alias("v", "version");

  // Disable the default "--help" behavior
  yargs.help(false);

  // Parse the command-line arguments
  let args = yargs.argv;

  // Normalize the parsed arguments
  let parsed = {
    command: args._[0],
    file: args._[1],
    options: {
      schema: args.schema,
      spec: args.spec,
      outfile: args.outfile,
      dereference: args.dereference,
      format: args.format || 2,
      type: args.type || "json",
      wrap: args.wrap || Infinity,
      debug: args.debug,
      help: args.help,
    }
  };

  if (parsed.options.debug) {
    console.log(JSON.stringify(parsed, null, 2));
  }

  return parsed;
}
586413
function(args) {
    var lastArgWasNumber = false;
    var numArgs = args.length;
    var strs = [];
    for (var ii = 0; ii < numArgs; ++ii) {
      var arg = args[ii];
      if (arg === undefined) {
        strs.push('undefined');
      } else if (typeof arg === 'number') {
        if (lastArgWasNumber) {
          strs.push(", ");
        }
        if (arg === Math.floor(arg)) {
          strs.push(arg.toFixed(0));
        } else {
        strs.push(arg.toFixed(3));
        }
        lastArgWasNumber = true;
      } else if (window.Float32Array && arg instanceof Float32Array) {
        // TODO(gman): Make this handle other types of arrays.
        strs.push(tdl.string.argsToString(arg));
      } else {
        strs.push(arg.toString());
        lastArgWasNumber = false;
      }
    }
    return strs.join("");
  }
1328328
function strictString(value, notSet) {
  if (Array.isArray(value)) return strictString(value[0], notSet)
  if (typeof value !== 'string') return notSet

  value = value.trim()
  return value === '' ? notSet : value
}
1357967
function cfg(notation, value, strategy) {
			var hasArg = arguments.length > 1;
			if (!notation) {
				return this.scope;
			}
			if (notation === true) {
				return assignStrategy({}, this.scope);
			}
			if (primitive(notation)) {
				return hasArg ? this.set(notation, value, strategy) : this.get(notation);
			}
			this.extends(notation);
			return this;
		}