Two-step argument splitting function that first splits arguments in quotes,
and then splits up the remaining arguments if they are not part of a quote.
772085
function splitArgsFromString(argsString) {
  let result = [];
  const quoteSeparatedArgs = argsString.split(/(\x22[^\x22]*\x22)/).filter(x => x);
  quoteSeparatedArgs.forEach(arg => {
    if (arg.match('\x22')) {
      result.push(arg.replace(/\x22/g, ''));
    } else {
      result = result.concat(arg.trim().split(' '));
    }
  });
  return result;
}
518110
def joinArgs(args):
    
    if not args:
        return ''
    arglist = []
    for key in sorted(args, key=lambda x: x.lower()):
        value = compat.ustr(args[key])
        arglist.append('%s=%s' % (key, compat.quote(value)))
    return '?%s' % '&'.join(arglist)
940814
def func_old_args(a, b=None, *args):  # pylint: disable=invalid-name
    """"""

    # We extract a specific optional parameter from *args
    try:
        c = args[0]
    except IndexError:
        c = None

    return a, b, c
38912
def _add_two_argument_command(self, command, arg1, arg2):
        """"""
        self.lines.append("{} {} {}".format(command, arg1, arg2))
414867
function mergeArgs(val) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
    }
    if (chek_1.isString(val))
        val = val.trim();
    if (!chek_1.isArray(val))
        val = [val];
    // flatten and remove dupes.
    return chek_1.flatten(val.concat(args))
        .sort()
        .filter(function (v, i, arr) {
        return !i || v !== arr[i - 1];
    });
}
751104
def split(args):
    
    p = OptionParser(split.__doc__)
    p.add_option("--chunk", default=4, type="int",
                 help="Split chunks of at least N markers")
    p.add_option("--splitsingle", default=False, action="store_true",
                 help="Split breakpoint range right in the middle")
    opts, args = p.parse_args(args)

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

    inputbed, = args
    bonus = 2
    nchunk = opts.chunk
    nbreaks = 0
    penalty = -(nchunk * bonus - 1)
    bed = Bed(inputbed)
    for seqid, bb in bed.sub_beds():
        markers = [Marker(x) for x in bb]
        markers = compute_score(markers, bonus, penalty)
        for mi, mj in pairwise(markers):
            if mi.mlg == mj.mlg:
                continue
            assert mi.seqid == mj.seqid
            start, end = mi.pos, mj.pos
            if start > end:
                start, end = end, start
            if opts.splitsingle:
                start = end = (start + end) / 2
            print("\t".join(str(x) for x in (mi.seqid, start - 1, end)))
            nbreaks += 1
    logging.debug("A total of {} breakpoints inferred (--chunk={})".\
                    format(nbreaks, nchunk))
1337324
function func (name, args, sep) {
    if (this.typecheck) t.typecheck('func', [name, args, sep]);
    if ('string'===typeof args) args = [args];
    return name+'('+args.join(sep||',')+')';
}
1341613
function concatenateArguments(args1, args2) {
                if (args1.params === undefined || args2.params === undefined)
                  return tr.b.concatenateObjects(args1, args2);
                // Make an argument object to hold the combined params.
                var args3 = {};
                args3.params = tr.b.concatenateObjects(args1.params,
                                                       args2.params);
                return tr.b.concatenateObjects(args1, args2, args3);
              }
1205378
function split(str, separator) {
    separator = separator || '';
    if (_.isString(str)) {
        return str.split(separator);
    } else {
        return str;
    }
}
1110641
public static List<String> split(String input, String punctuationChars, String quoteChars) {
		return split(input, punctuationChars, quoteChars, false, false, false);
	}
1362923
function castArgument(arg) {
		if (isNumber(arg)) {
			return parseFloat(arg);
		}

		if (helpers.isFraction(arg)) {
			arg = arg.split('/');

			return arg[0] / arg[1];
		}

		if (arg === 'false' || arg === 'true') {
			return arg === 'true';
		}

		return arg.length ? arg : undefined;
	}
854454
def split_args(self, arg_dict):
        
        pos_args = []
        for arg in self.args:
            pos_args.append(arg_dict[arg.name])
            del arg_dict[arg.name]
        return pos_args, arg_dict
396530
def kwarg(string, separator='='):
    """"""
    if separator not in string:
        raise ValueError("Separator '%s' not in value '%s'"
                         % (separator, string))
    if string.strip().startswith(separator):
        raise ValueError("Value '%s' starts with separator '%s'"
                         % (string, separator))
    if string.strip().endswith(separator):
        raise ValueError("Value '%s' ends with separator '%s'"
                         % (string, separator))
    if string.count(separator) != 1:
        raise ValueError("Value '%s' should only have one '%s' separator"
                         % (string, separator))
    key, value = string.split(separator)
    return {key: value}
257686
function _unquoteArgs(args) {
    for (var i = 0; i < args.length; i++) {
        if (_isQuoted(args[i])) args[i] = _unquote(args[i]);
    }
}
226130
function returnArgumentHasLeadingComment(options, argument) {
  if (hasLeadingOwnLineComment(options.originalText, argument, options)) {
    return true;
  }

  if (hasNakedLeftSide(argument)) {
    let leftMost = argument;
    let newLeftMost;
    while ((newLeftMost = getLeftSide(leftMost))) {
      leftMost = newLeftMost;

      if (hasLeadingOwnLineComment(options.originalText, leftMost, options)) {
        return true;
      }
    }
  }

  return false;
}
1082605
function mergeArgs(def, args, exclude) {
    exclude = splitArgs(exclude || []);
    def = normalizeArgs(def);
    args = normalizeArgs(args);
    var clone = def.slice(0);
    args.forEach(function (arg, i) {
        var next = args[i + 1];
        var isFlag = _flagExp.test(arg);
        var isFlagNext = _flagExp.test(next || '');
        var defIdx = def.indexOf(arg);
        // Arg exists check if flag that accepts value.
        if (~defIdx && isFlag && !isFlagNext) {
            clone[defIdx + 1] = next;
            args.splice(i + 1, 1);
        }
        // new arg just push.
        else if (!~defIdx) {
            clone.push(arg);
        }
    });
    return filterArgs(clone, exclude);
}
615715
function (delimiter, string, limit) {

            if (arguments.length < 2 ||
                typeof delimiter === "undefined" ||
                typeof string === "undefined"
            ) {
                return null;
            }

            if (delimiter === "" ||
                delimiter === false ||
                delimiter === null
            ) {
                return false;
            }

            if (delimiter === true) {
                delimiter = "1";
            }

            // Here we go...
            delimiter += "";
            string += "";

            var splited = string.split(delimiter);

            if (typeof limit === "undefined") {
                return splited;
            }

            // Support for limit
            if (limit === 0) {
                limit = 1;
            }

            // Positive limit
            if (limit > 0) {
                if (limit >= splited.length) {
                    return splited;
                }

                return splited.slice(0, limit - 1)
                    .concat([splited.slice(limit - 1)
                        .join(delimiter)
                    ]);
            }

            // Negative limit
            if (-limit >= splited.length) {
                return [];
            }

            splited.splice(splited.length + limit);

            return splited;
        }