Return args object with new coordinates based on behavior
@returns {Object} args
10935
function smartCoordinates(args) {
  var x = args.x,
    y = args.y;

  var paper = Origami.getPaper(),
    elmWidth = paper.element.width,
    elmHeight = paper.element.height,
    radius = (args.r || 0);

  var width = (args.width || radius),
    height = (args.height || width);

  var axis = {
    x: [ 'right', 'center', 'left' ],
    y: [ 'top', 'center', 'bottom' ]
  };

  if (axis.x.indexOf(x) !== -1) {
    if (x === 'right')
      x = Math.floor(elmWidth - width);
    else if (x === 'center')
      if (radius)
        x = Math.floor(elmWidth / 2)
      else
        x = Math.floor((elmWidth / 2) - (width / 2));
    else if (x === 'left')
      x = radius;
  } else if ((x + '').substr(-1) === '%') {
    x = (elmWidth * parseInt(x, 10)) / 100;
  } else {
    x = 0;
  }

  if (axis.y.indexOf(y) !== -1) {
    if (y === 'top')
      y = radius;
    else if (y === 'center')
      if (radius)
        y = Math.floor(elmHeight / 2);
      else
        y = Math.floor((elmHeight / 2) - (height / 2));
    else if (y === 'bottom')
      y = Math.floor(elmHeight - height);
  } else if ((y + '').substr(-1) === '%') {
    y = (elmHeight * parseInt(y, 10)) / 100;
  } else {
    y = 0;
  }

  args.y = y;
  args.x = x;
  return args;
}
855302
function(args){
			return forEach(args,function(_,item){
				var messages = this.result,
					type = typeof item;

				if (type == 'string') {
					messages.push('%s');
				} else if (type == 'number') {
					messages.push('%d');
				} else if (type == 'boolean') {
					messages.push('%s');
				} else {
					messages.push('%O');
				}
			},[]);
		}
1304996
function wrapArguments(trace, clientState, hooks) {
  //wrap any callbacks found in the arguments
  var args = trace.args;
  var handler = clientState.rules.handleArgs(trace.funInfo.name);
  if (handler) {
    handler(trace, clientState);
  }
  for (var i = args.length - 1; i >= 0; i--) {
    var a = args[i];
    if (util.isFunction(a) && !a.__concurix_blacklisted) {
      var callbackState = {
        modInfo: clientState.modInfo,
        rules: clientState.rules,
        callbackOf: trace
      };

      if (wrap.isWrapper(args[i])) {
        args[i].__concurix_proxy_state__
          .module((trace.calledBy && trace.calledBy.moduleName) || 'root')
          .state(callbackState)
          .nameIfNeeded(trace.funInfo.name + ' callback')
          .getProxy();
      }
      else {
        args[i] = wrap(a)
          .before(hooks.beforeHook)
          .after(hooks.afterHook)
          .module((trace.calledBy && trace.calledBy.moduleName) || 'root')
          .state(callbackState)
          .nameIfNeeded(trace.funInfo.name + ' callback')
          .getProxy();
      }
      trace.origFunctionArguments = trace.origFunctionArguments || [];
      trace.origFunctionArguments.push(a);
    }
  }
}
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("");
  }
407524
function observeArgs(args, run) {

  function observeArg(arg, i, args) {
    var observer = Observer(
      arg,
      function argObserver(changes) {
        changes.forEach(({type, newValue}) => {
          if (type === 'upward') {
            args[i] = newValue;
            observer.reobserve(newValue);
          }
        });

        run();
      },
      // @TODO: consider whether to check for D/A/U here, or use 'modify' change type
      ['upward', 'delete', 'add', 'update'] // @TODO: check all these are necessary
    );
    observer.observe();
  }

  args.forEach(observeArg);
}
860877
def randomize_args(self):
        '''
        '''
        args = self.spiro_args + np.random.normal(0, self.move_radius,
                                                  self.spiro_args.shape)
        np.clip(args, -199, 199, args)
        while args[0] == 0 or args[1] == 0:
            args = self.spiro_args + np.random.normal(0, self.move_radius,
                                                      self.spiro_args.shape)
            np.clip(args, -199, 199, args)
        return args
419064
function get_args( args, fn_curr, fn_prev ) {
		if ( args.length && OP.toString.call( args[0] ) === '[object Arguments]' ) {
			if ( args.length < 2 && arguments.length > 1 ) {
				if ( fn_curr in internal_method_names )
					return get_args( args[0] );
				if ( fn_prev && fn_curr === fn_prev )
					return args[0];
			}
		}
		return args;
	}
1175132
function () {

        var a = arguments;

        if( typeof a[1] === 'object' ){ 

            a[1].isUI = true;
            a[1].main = this;

        } else if( typeof a[1] === 'string' ){

            if( a[2] === undefined ) [].push.call(a, { isUI:true, main:this });
            else {
                a[2].isUI = true;
                a[2].main = this;
            }
            
        } 

        var u = add.apply( this, a );

        if( u === null ) return;


        //var n = add.apply( this, a );
        //var n = UIL.add( ...args );

        this.uis.push( u );
        //n.py = this.h;

        if( !u.autoWidth ){
            var y = u.c[0].getBoundingClientRect().top;
            if( this.prevY !== y ){
                this.calc( u.h + 1 );
                this.prevY = y;
            }
        }else{
            this.prevY = 0;//-1;
            this.calc( u.h + 1 );
        }

        return u;

    }
498891
function (arguments) {
                var argData = ArgumentHelpers.prepareCallback(arguments);
                var callback = argData.callback;
                var args = argData.arguments;
                if (callback) {
                    args.pop();
                }
                return args;
            }
585109
function getArgs (uriMappers, location) {
  var args = null;

  uriMappers.some(mapper => {
    if (mapper.expression.test(location.path)) {
      args = mapper.argsMap(location) || Object.create(null);
      return true;
    }
    return false;
  });

  return args;
}
1349242
function argsToObject(args) {
  var options = {};
  options.address = args.shift();
  options.output = args.shift();

  // Pair two arguments, while transforming the key to camelCase
  for (i = 0; i < args.length; i = i + 2) {
    options[toCamelCase(args[i].substr(2))] = args[i + 1];
  }

  return options;
}
573388
function buildArguments (argz) {
  var args = argz.cmd.split(' ')
  argz.cmd = args.shift()
  argz.args = union([], args || [], argz.args || [])
  return argz
}
632581
function ParsedArgs (args) {
  /**
   * The command to run ("browserify" or "watchify")
   * @type {string}
   */
  this.cmd = "browserify";

  /**
   * The base directory for the entry-file glob pattern.
   * See {@link helpers#getBaseDir} for details.
   * @type {string}
   */
  this.baseDir = "";

  /**
   * Options for how the entry-file glob pattern should be parsed.
   * For example if an --exclude argument is specified, then `globOptions.ignore` will be set accordingly.
   * @type {object}
   */
  this.globOptions = { ignore: []};

  /**
   * The index of the entry-file glob argument.
   * If there is no entry-file argument, or it's not a glob pattern, then this will be -1.
   * @type {number}
   */
  this.globIndex = -1;

  /**
   * The index of the outfile argument.
   * If there is no outfile argument, or it's not a glob pattern, then this will be -1;
   * @type {number}
   */
  this.outfileIndex = -1;

  /**
   * The arguments to pass to browserify.
   * If {@link globIndex} or {@link outfileIndex} are set, then the corresponding elements in
   * this array will be the corresponding functions.
   * @type {Array}
   */
  this.args = [];

  args = args || [];
  while (args.length > 0) {
    parseOutfile(args, this) ||
    parseExclude(args, this) ||
    parseWatch(args, this) ||
    parseSubArgs(args, this) ||
    parseDashArgs(args, this) ||
    parseGlobs(args, this) ||
    passThrough(args, this);
  }
}
573489
function getArguments() {
  var port = 3000;
  var path = '.';
  var args = process.argv.slice(2);

  while (args.length) {
    var arg = args.shift();
    switch (arg) {
      case '-p':
        port = args.shift();
        break;
      default:
        path = arg || path;
    }
  }

  return {
    port: port,
    path: path
  };
}
471847
function ( arg ) {
		var result;

		if ( !arg ) {
			return;
		}

		arg = string.trim( arg );

		if ( arg.indexOf( "," ) === -1 ) {
			result = utility.dom( arg );
		}
		else {
			result = [];

			array.each( string.explode( arg ), function ( query ) {
				var obj = utility.dom( query );

				if ( obj instanceof Array ) {
					result = result.concat( obj );
				}
				else if ( obj ) {
					result.push( obj );
				}
			});
		}

		return result;
	}
280318
function(args) {
    var mode = (args && args['mode']) || 'update';
    return map(function(code, filename) {
        var lines = code.toString().split("\n");
        var gists = {};
        var currentGist = null;
        var lineNo = 0;
        lines.forEach(function(line) {
            if (line.indexOf("// startgist:") > -1 || line.indexOf("# startgist:") > -1) {
                if (currentGist) {
                    throw new PluginError(PLUGIN_NAME, filename + ":" + lineNo + ": Unexpected startgist: a previous gist was not closed");
                }
                currentGist = {
                    "id": line.split(":")[1].trim(),
                    "filename": line.split(":")[2].trim(),
                    "lines": []
                };
            } else if (line.indexOf("// endgist") > -1 || line.indexOf("# endgist") > -1) {
                if (!currentGist) {
                    throw new PluginError(PLUGIN_NAME, filename + ":" + lineNo + " Unexpected endgist: missing startgist earlier");
                }
                if (!gists[currentGist.id]) {
                    gists[currentGist.id] = {};
                }
                gists[currentGist.id][currentGist.filename] = {
                    'content': leftAlign(currentGist.lines).join("\n")
                };
                currentGist = null;
            } else if (currentGist && line.indexOf("gisthide") == -1) {
                currentGist.lines.push(line);
            }
            lineNo += 1;
        });
        if (currentGist) {
            throw new PluginError(PLUGIN_NAME, "Reached end of file but gist is still open");
        }
        if (mode == 'create') {
            return fs.read(getUserHome() + '/.gistauth', 'b').then(function (auth) {
                return Q.all(Object.keys(gists).map(function(id) {
                    return create(auth, gists[id]);
                }));
            }).done();
        } else if (mode == 'update') {
            return fs.read(getUserHome() + '/.gistauth', 'b').then(function (auth) {
                return Q.all(Object.keys(gists).map(function(id) {
                    return patch(auth, id, gists[id]);
                }));
            }).done();
        } else {
            gutil.log('Gist mock: ', gists);
        }
    });
}
783662
function(arg, callback) {
    if (!arg || typeof arg !== 'object') return;

    if (arg instanceof Array) {
      arg.forEach(callback);
    } else {
      for (var k in arg) {
        callback(arg[k], k);
      }
    }
  }