/*# if only one arg, it is assumed to be a Range.  If 2 args, both are cell addresses
778050
function encode_range(cs/*:CellAddrSpec|Range*/,ce/*:?CellAddrSpec*/)/*:string*/ {
	if(typeof ce === 'undefined' || typeof ce === 'number') {
/*:: if(!(cs instanceof Range)) throw "unreachable"; */
		return encode_range(cs.s, cs.e);
	}
/*:: if((cs instanceof Range)) throw "unreachable"; */
	if(typeof cs !== 'string') cs = encode_cell((cs/*:any*/));
	if(typeof ce !== 'string') ce = encode_cell((ce/*:any*/));
/*:: if(typeof cs !== 'string') throw "unreachable"; */
/*:: if(typeof ce !== 'string') throw "unreachable"; */
	return cs == ce ? cs : cs + ":" + ce;
}
1008350
function(ranges) {
      let unstaggeredRanges = [];
      ranges.forEach(function(range) {
        let isStaggered = unstaggeredRanges.some(function(unstaggeredRange) {
          let isStartInside =
            range[0] > unstaggeredRange[0] && range[0] < unstaggeredRange[1];
          let isStopInside =
            range[1] > unstaggeredRange[0] && range[1] < unstaggeredRange[1];
          return isStartInside !== isStopInside; // xor
        });
        if (!isStaggered) {
          unstaggeredRanges.push(range);
        }
      });
      return unstaggeredRanges;
    }
2165
function lookup(tag, range) {
  var pos

  tag = lower(tag)
  range = lower(range)

  while (true) {
    if (range === asterisk || tag === range) {
      return true
    }

    pos = range.lastIndexOf(dash)

    if (pos === -1) {
      return false
    }

    if (pos > 3 && range.charAt(pos - 2) === dash) {
      pos -= 2
    }

    range = range.substring(0, pos)
  }
}
857253
function(){
		var bd = this.board;
		for(var c=0;c<bd.cell.length;c++){
			var cell = bd.cell[c], adb = cell.adjborder;
			if( (!adb.top.isLine()    || !cell.noLP(cell.UP)) &&
				(!adb.bottom.isLine() || !cell.noLP(cell.DN)) &&
				(!adb.left.isLine()   || !cell.noLP(cell.LT)) &&
				(!adb.right.isLine()  || !cell.noLP(cell.RT)) )
			{ continue;}
		
			this.failcode.add("ceAddLine");
			if(this.checkOnly){ break;}
			cell.seterr(1);
		}
	}
75497
function(argv) {
  if (!_.isArray(argv)) {
    return false;
  }
  var nonStringsFound = _.find(argv, function(arg) {
    return !_.isString(arg);
  });
  return !nonStringsFound;
}
939975
function rangeParser (size, str, options) {
  if (typeof str !== 'string') {
    throw new TypeError('argument str must be a string')
  }

  var index = str.indexOf('=')

  if (index === -1) {
    return -2
  }

  // split the range string
  var arr = str.slice(index + 1).split(',')
  var ranges = []

  // add ranges type
  ranges.type = str.slice(0, index)

  // parse all ranges
  for (var i = 0; i < arr.length; i++) {
    var range = arr[i].split('-')
    var start = parseInt(range[0], 10)
    var end = parseInt(range[1], 10)

    // -nnn
    if (isNaN(start)) {
      start = size - end
      end = size - 1
    // nnn-
    } else if (isNaN(end)) {
      end = size - 1
    }

    // limit last-byte-pos to current length
    if (end > size - 1) {
      end = size - 1
    }

    // invalid or unsatisifiable
    if (isNaN(start) || isNaN(end) || start > end || start < 0) {
      continue
    }

    // add range
    ranges.push({
      start: start,
      end: end
    })
  }

  if (ranges.length < 1) {
    // unsatisifiable
    return -1
  }

  return options && options.combine
    ? combineRanges(ranges)
    : ranges
}
163101
function(){
		this.decodeCell( function(cell,ca){
			if     (ca==="+"){ cell.qsub = 1;}
			else if(ca==="-"){ cell.qsub = 2;}
			else if(ca==="="){ cell.qsub = 3;}
			else if(ca==="%"){ cell.qsub = 4;}
			else if(ca!=="."){ cell.qans = +ca;}
		});
	}
40423
function invIncBeta(p, a, b) {
  if(x < 0 || x > 1) {
    throw new RangeError('First argument must be between 0 and 1.');
	}

  // Special cases, there can make trouble otherwise
  else if (a === 1 && b === 1) return p;
  else if (p === 1) return 1;
  else if (p === 0) return 0;
  else if (a === 0) return 0;
  else if (b === 0) return 1;

  else {
    var EPS = 1e-8,
        a1 = a - 1,
        b1 = b - 1,
        j = 0,
        lna, lnb, pp, t, u, err, x, al, h, w, afac;

	if(a >= 1 && b >= 1) {
    pp = (p < 0.5) ? p : 1 - p;
    t = Math.sqrt(-2 * Math.log(pp));

		x = (2.30753 + t * 0.27061) / (1 + t* (0.99229 + t * 0.04481)) - t;
		if(p < 0.5) x = -x;
		al = (x * x - 3) / 6;
		h = 2 / (1 / (2 * a - 1)  + 1 / (2 * b - 1));
		w = (x * Math.sqrt(al + h) / h) - (1 / (2 * b - 1) - 1 / (2 * a - 1)) * (al + 5 / 6 - 2 / (3 * h));
		x = a / (a + b * Math.exp(2 * w));
	} else {
		lna = Math.log(a / (a + b));
		lnb = Math.log(b / (a + b));
		t = Math.exp(a * lna) / a;
		u = Math.exp(b * lnb) / b;
		w = t + u;
		if (p < t / w) x = Math.pow(a * w * p, 1 / a);
		else x = 1 - Math.pow(b * w * (1 - p), 1 / b);
	}

	afac = -gammaCollection.logGamma(a) - gammaCollection.logGamma(b) + gammaCollection.logGamma(a + b);

  for(; j < 10; j++) {
		if(x === 0 || x === 1) return x;
		err = regualizedBeta(x, a, b) - p;

    t = Math.exp(a1 * Math.log(x) + b1 * log1p(-x) + afac);
		u = err / t;
		x -= (t = u / (1 - 0.5 * Math.min(1, u * (a1 / x - b1 / (1 - x)))));

    if (x <= 0) x = 0.5 * (x + t);
		if (x >= 1) x = 0.5 * (x + t + 1);

		if (Math.abs(t) < EPS * x && j > 0) break;
	}

	return x;
  }
}
1151258
function isInRange(node, location) {
    return node && node.range[0] <= location && location <= node.range[1];
}
97729
function spaces(arg1, arg2) {
    var l, builder = [];
    if(arg1.constructor === Number) {
        l = arg1;
    } else {
        if(arg1.length == arg2) return arg1;
        l = arg2 - arg1.length;
        builder.push(arg1);
    }
    while(l-- > 0) builder.push(' ');
    return builder.join('');
}
502504
def set_argument(bound_args, address, value):
    
    if address.kind == ArgumentKind.regular:
        bound_args.arguments[address.name] = value
        return

    if address.kind == ArgumentKind.variadic:
        if address.name not in bound_args.arguments:
            bound_args.arguments[address.name] = []

        n_args = len(bound_args.arguments[address.name])
        if address.key >= n_args:
            bound_args.arguments[address.name].extend(
                repeat(Empty, address.key - n_args + 1))

    if address.kind == ArgumentKind.keyword:
        if address.name not in bound_args.arguments:
            bound_args.arguments[address.name] = {}

    bound_args.arguments[address.name][address.key] = value
351619
function ( arg ) {
		if ( arg !== undefined ) {
			document.location.hash = arg;
		}

		return document.location.hash;
	}
855279
function(domain, range, value) {

            var domainSpan = domain[1] - domain[0];
            var rangeSpan = range[1] - range[0];
            return (((value - domain[0]) / domainSpan) * rangeSpan + range[0]) || 0;
        }
668431
function (text, arg1, arg2, arg3) {
    text = translateWord(text);

    var pos = text.indexOf('%s');
    if (pos !== -1) {
        text = text.replace('%s', arg1);
    } else {
        return text;
    }

    pos = text.indexOf('%s');
    if (pos !== -1)  {
        text = text.replace('%s', arg2);
    } else {
        return text;
    }

    pos = text.indexOf('%s');
    if (pos !== -1)  {
        text = text.replace('%s', arg3);
    }

    return text;
}
1329729
private void handleRange(final String range) {

		final String[] parts = range.split("[\\-]+");
		switch (parts.length) {

			case 1:
				// no range
				final Integer singleNumber = toInt(parts[0]);
				if (singleNumber != null) {

					ranges.add(new Range(singleNumber, singleNumber));
				}
				break;

			case 2:
				// valid range
				final Integer first = toInt(parts[0]);
				final Integer last  = toInt(parts[1]);

				if (first != null && last != null) {

					ranges.add(new Range(first, last));

				} else {

					throw new IllegalArgumentException("Range must have two boundaries");
				}
				break;

			default:
				logger.warn("Invalid range specification, unable to parse {}, ignoring.", range);
		}
	}
274336
def num_cells_in_range(str)
      cells = str.split(':')
      return 1 if cells.count == 1
      raise ArgumentError.new("invalid range string: #{str}. Supported range format 'A1:B2'") if cells.count != 2
      x1, y1 = extract_coordinate(cells[0])
      x2, y2 = extract_coordinate(cells[1])
      (x2 - (x1 - 1)) * (y2 - (y1 - 1))
    end
720705
static boolean areAllArgumentsOfSameType(Object[] arguments) {
        if (arguments == null || arguments.length <= 1) {
            return true;
        }

        // Handle null values
        int index = 0;
        Object object = null;
        while (object == null && index < arguments.length) {
            object = arguments[index++];
        }

        if (object == null) {
            return true;
        }
        // End of handling null values

        final Class<?> firstArgumentType = getType(object);
        for (int i = index; i < arguments.length; i++) {
            final Object argument = arguments[i];
            if (argument != null && !getType(argument).isAssignableFrom(firstArgumentType)) {
                return false;
            }
        }

        return true;
    }