FIXME: missing doc
@param {Object} args
965138
function (args) {
                var refreshMgrInfo = this._registerInRefreshMgr();
                refreshMgrInfo.queue = null;
                if(refreshMgrInfo.refreshArgs && refreshMgrInfo.refreshArgs.animate){
                    args.animate = true;
                }
                refreshMgrInfo.refreshArgs = args;
            }
1144580
function fixOldRadialGradient (args) {
	let position = args[0];
	if (position && position[0] && position[1]) {
		// 第一个参数为坐标，则将这个参数中的值的单位转换为px
		position = position.map(px);
		// 在坐标参数最前面添加`at`关键字
		position.unshift("at");

		const size = args[3] && args[3][0];
		if (size != null) {
			// 将尺寸信息加入结果集
			position.unshift(px(size));
		}
		// 返回结果
		return position;
	}
}
744526
function parseArgs(args) {
  var options = {
    arch: process.arch,
    platform: process.platform,
    force: process.env.npm_config_force === 'true',
  };

  options.args = args.filter(function(arg) {
    if (arg === '-f' || arg === '--force') {
      options.force = true;
      return false;
    } else if (arg.substring(0, 13) === '--target_arch') {
      options.arch = arg.substring(14);
    } else if (arg === '-d' || arg === '--debug') {
      options.debug = true;
    } else if (arg.substring(0, 13) === '--libsass_ext' && arg.substring(14) !== 'no') {
      options.libsassExt = true;
    }

    return true;
  });

  return options;
}
436134
function formatArguments(args) {
    if (Array.isArray(args)) {
        return args.map(function (item) {
            return formatArgument(item);
        });
    } else if (typeof args === 'string' || args instanceof String) {
        return [formatArgument(args)];
    }
    console.error(`${PLUGIN_NAME} : Arguments are not passed in a valid format: ${args}`);
    return [];
}
557130
function processArgs(args, files = []) {
  return args.reduce((acc, arg) => {
    let stats;
    try {
      stats = fs.statSync(arg);
    } catch (err) {
      // Do nothing
    }

    // If argument is a directory, process the files inside
    if (stats && stats.isDirectory()) {
      return processArgs(
        fs.readdirSync(arg).map(file => path.join(arg, file)),
        files
      );
    }

    // If `statSync` failed, validating will handle the error
    // If the argument is a file, check if its a JSON file before validating
    if (!stats || JsonFileRegex.test(arg)) {
      acc.push(validateFile(arg));
    }

    return acc;
  }, files);
}
373386
function substArguments(str, args, key) {
        var reArgs = /\{\{\s*(.+?)\s*\}\}/g;
        return str.replace(reArgs, function(matched_text, arg) {
            if (args && arg in args) {
                return args[arg];
            }
            if (arg in gL10nData) {
                return gL10nData[arg];
            }
            console.log("argument {{" + arg + "}} for #" + key + " is undefined.");
            return matched_text;
        });
    }
200294
function (args) {
    Model.call(this, args);
    this.modelType = messageContents.modelType;
    this.attributes = [];
    for (var a in messageContents.attributes) {
      var attrib = new Attribute(messageContents.attributes[a].name, messageContents.attributes[a].type);
      if (attrib.name == 'id') { // TODO only If mongo! or refactor mongo to normalize IDs
        attrib.value = messageContents.attributes[a].value;
      } else {
        attrib.value = messageContents.attributes[a].value;
      }
      this.attributes.push(attrib);
    }
  }
154146
function extractKwargs(args) {
    var last = args[args.length - 1];
    return (is.object(last) && last.__keywords)? args.pop() : {};
}
290967
function (node, args) {
          var self = this, impl, doc, oldDoc, htmlSerializer, content, rootNode;

          // Explorer won't clone contents of script and style and the
          // selected index of select elements are cleared on a clone operation.
          if (Env.ie && dom.select('script,style,select,map').length > 0) {
            content = node.innerHTML;
            node = node.cloneNode(false);
            dom.setHTML(node, content);
          } else {
            node = node.cloneNode(true);
          }

          // Nodes needs to be attached to something in WebKit/Opera
          // This fix will make DOM ranges and make Sizzle happy!
          impl = document.implementation;
          if (impl.createHTMLDocument) {
            // Create an empty HTML document
            doc = impl.createHTMLDocument("");

            // Add the element or it's children if it's a body element to the new document
            each(node.nodeName == 'BODY' ? node.childNodes : [node], function (node) {
              doc.body.appendChild(doc.importNode(node, true));
            });

            // Grab first child or body element for serialization
            if (node.nodeName != 'BODY') {
              node = doc.body.firstChild;
            } else {
              node = doc.body;
            }

            // set the new document in DOMUtils so createElement etc works
            oldDoc = dom.doc;
            dom.doc = doc;
          }

          args = args || {};
          args.format = args.format || 'html';

          // Don't wrap content if we want selected html
          if (args.selection) {
            args.forced_root_block = '';
          }

          // Pre process
          if (!args.no_events) {
            args.node = node;
            self.onPreProcess(args);
          }

          // Parse HTML
          content = Zwsp.trim(trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)));
          rootNode = htmlParser.parse(content, args);
          trimTrailingBr(rootNode);

          // Serialize HTML
          htmlSerializer = new Serializer(settings, schema);
          args.content = htmlSerializer.serialize(rootNode);

          // Post process
          if (!args.no_events) {
            self.onPostProcess(args);
          }

          // Restore the old document if it was changed
          if (oldDoc) {
            dom.doc = oldDoc;
          }

          args.node = null;

          return args.content;
        }
133270
function compile(args) {
  var filenames = [];
  var opts = {
    grammar: null,
    b: false,  // Benchmark (print matching times).
    v: false   // Verbose
  };

  // Super basic command line option parsing.
  for (var i = 0; i < args.length; ++i) {
    if (args[i] === '-g') {
      opts.grammar = args[++i];
    } else if (args[i][0] === '-' && opts.hasOwnProperty(args[i][1])) {
      opts[args[i][1]] = true;
    } else {
      filenames.push(args[i]);
    }
  }

  var lang = opts.grammar ? loadModule(opts.grammar) : es5;

  var files = filenames.map(function(name) {
    // If benchmarking, read in all the files at once, so that we can just time the matching.
    return [name, opts.b ? removeShebang(fs.readFileSync(name).toString()) : null];
  });

  var matchStartTime = Date.now();

  // Parsing -- bails out when the first error is encountered.
  var results = [];
  var succeeded = files.every(function(arr) {
    var source = arr[1] || removeShebang(fs.readFileSync(arr[0]).toString());
    if (opts.v) { console.error(arr[0]); }
    var result = lang.grammar.match(source, 'Program');
    if (result.succeeded()) {
      results.push(result);
      return true;
    }
    console.error(arr[0] + ':\n' + result.message);
    return false;
  });

  if (succeeded) {
    if (opts.b) { console.error('Matching:', (Date.now() - matchStartTime) + 'ms'); }

    // Codegen
    var code = '';
    var codegenStartTime = Date.now();
    results.forEach(function(r) { code += ';\n' + lang.semantics(r).toES5(); });
    if (opts.b) {
      console.error('Codegen:', (Date.now() - codegenStartTime) + 'ms');
    }
    return code;
  }
  return null;
}
160664
def refine(args):
    
    p = OptionParser(refine.__doc__)
    p.add_option("--closest", default=False, action="store_true",
                 help="In case of no gaps, use closest [default: %default]")
    opts, args = p.parse_args(args)

    if len(args) != 2:
        sys.exit(not p.print_help())

    breakpointsbed, gapsbed = args
    ncols = len(open(breakpointsbed).next().split())
    logging.debug("File {0} contains {1} columns.".format(breakpointsbed, ncols))
    cmd = "intersectBed -wao -a {0} -b {1}".format(breakpointsbed, gapsbed)

    pf = "{0}.{1}".format(breakpointsbed.split(".")[0], gapsbed.split(".")[0])
    ingapsbed = pf + ".bed"
    sh(cmd, outfile=ingapsbed)

    fp = open(ingapsbed)
    data = [x.split() for x in fp]

    nogapsbed = pf + ".nogaps.bed"
    largestgapsbed = pf + ".largestgaps.bed"
    nogapsfw = open(nogapsbed, "w")
    largestgapsfw = open(largestgapsbed, "w")
    for b, gaps in groupby(data, key=lambda x: x[:ncols]):
        gaps = list(gaps)
        gap = gaps[0]
        if len(gaps) == 1 and gap[-1] == "0":
            assert gap[-3] == "."
            print("\t".join(b), file=nogapsfw)
            continue

        gaps = [(int(x[-1]), x) for x in gaps]
        maxgap = max(gaps)[1]
        print("\t".join(maxgap), file=largestgapsfw)

    nogapsfw.close()
    largestgapsfw.close()
    beds = [largestgapsbed]
    toclean = [nogapsbed, largestgapsbed]

    if opts.closest:
        closestgapsbed = pf + ".closestgaps.bed"
        cmd = "closestBed -a {0} -b {1} -d".format(nogapsbed, gapsbed)
        sh(cmd, outfile=closestgapsbed)
        beds += [closestgapsbed]
        toclean += [closestgapsbed]
    else:
        pointbed = pf + ".point.bed"
        pbed = Bed()
        bed = Bed(nogapsbed)
        for b in bed:
            pos = (b.start + b.end) / 2
            b.start, b.end = pos, pos
            pbed.append(b)
        pbed.print_to_file(pointbed)
        beds += [pointbed]
        toclean += [pointbed]

    refinedbed = pf + ".refined.bed"
    FileMerger(beds, outfile=refinedbed).merge()

    # Clean-up
    FileShredder(toclean)

    return refinedbed
401767
function buildArgs(options) {
    // access, private, readme, template, etc.. These CLI options do not
    // have affect when run with --explain (-X) flag. They are for
    // jsdoc-genrated docs. access is handled within the filter method.
    const opts = _.defaults(options, {
        // files: ... // non-jsdoc option
        encoding: 'utf8',
        package: null, // path
        recurse: false,
        pedantic: false,
        query: null
        // debug: false
        // verbose: false
    });

    let args = ['-X'];
    args = args.concat(helper.ensureArray(opts.files));
    args.push('-e', opts.encoding);
    if (_.isString(opts.package)) {
        args.push('-P', opts.package);
    }
    if (opts.recurse) args.push('-r');
    if (opts.pedantic) args.push('--pedantic');
    if (opts.query) args.push('-q', opts.query);
    // if (opts.debug) args.push('--debug');
    // if (opts.verbose) args.push('--verbose');
    return args;
}
1040746
static String resolveArgument(String[] args) {
    return Optional.ofNullable(args).map(ArrayUtils::getFirst).filter(StringUtils::hasText)
      .orElseThrow(() -> newIllegalArgumentException("Directory is required"));
  }
840563
function (args, callback) {
        if (ternserver) {
          var query =
            {
              type: "beautify",  //$NON-NLS-1$
              file: args.meta.location,
              args: {
                config: args.config,
                start: args.start,
                end: args.end,
                contentType: args.contentType
              }
            };
          ternserver.request(
            {
              query: query,
              files: args.files
            },
            function (error, text) {
              if (error) {
                callback({request: 'beautify', error: error.message, message: Messages['failedToFormat']}); //$NON-NLS-1$
              } else if (text) {
                callback({request: 'beautify', text: text}); //$NON-NLS-1$
              } else {
                callback({request: 'beautify', text: ""}); //$NON-NLS-1$
              }
            }
          );
        } else {
          callback(null, {message: Messages['failedToFormatNoServer']});
        }
      }
241363
function(arg) {
		var spirit, element, doc = document;
		switch (gui.Type.of(arg)) {
			case "string":
				if (gui.KeyMaster.isKey(arg)) {
					spirit = this._spirits.inside[arg];
				}
				if (!spirit) {
					try {
						element = doc.querySelector(arg) || doc.querySelector('#' + arg);
					} catch (badselector) {

					} finally {
						spirit = element ? element.spirit : null;
					}
				}
				break;
			case "function":
				var sp, spirits = this._spirits.inside;
				if (gui.Type.isSpiritConstructor(arg)) {
					Object.keys(this._spirits.inside).some(function(key) {
						if (((sp = spirits[key]).constructor === arg)) {
							spirit = sp;
							return true;
						}
					});
				}
				break;
			default:
				if (gui.Type.isElement(arg)) {
					spirit = arg.spirit || null;
				} else {
					throw new TypeError('gui.get(' + arg + ')');
				}
				break;
		}
		return spirit || null;
	}
562050
function(command, arg) {
    if (!arg) {
      arg = 'default';
    }

    if (!commands[command]) {
      grunt.fail.fatal('Command [' + command + '] not found.');
    }

    // Check arg
    if (typeof (commands[command]) !== 'function') {
      if (!commands[command][arg]) {
        grunt.fail.fatal('Argument [' + arg + '] for [' + command
            + '] not found.');
      }
    }

    var func = (arg) ? commands[command][arg] : commands[command];
    if (!func) {
      func = commands[command]; // fallback to the main function
    }

    var options = this.options();
    var docker = (options.docker) ? new Docker(options.docker) : null;
    var done = this.async();

    var callback = function(e) {
      if (e) {
        grunt.fail.warn(e);
      }
      done();
    };

    func.apply(this, [ grunt, docker, options, callback, arg ]);
  }
458512
function assertArguments(options, argnames) {
  if (!argnames) return;
  if (!options) throw new TypeError('missing arguments: ' + argnames);
  argnames.forEach(function (argname) {
    if (!options.hasOwnProperty(argname)) {
      throw new TypeError('missing argument: ' + argname);
    }
  });
}