showReport(foo) => ["showReport(foo)", "showReport", "foo"] showReport(12) => ["showReport(12)", "showReport", "12"]
169481
function extractFunctionCall(str) {
      var match = /(\w+)\((.*)\)/.exec(str);
      if (!match) throw new Error("Invalid click handler '"+str+"'");

      return {
        "method": match[1],
        "args": match[2].split(',')
      };
    }
229911
def totals(report, total_roles, role_name_length):
    
    roles_len_string = len(str(total_roles))
    roles_label_len = 6  # "r" "o" "l" "e" "s" " "

    if clr.has_colors:
        roles_count_offset = 22
    else:
        roles_count_offset = 13

    roles_count_offset += role_name_length

    # no idea honestly but it fixes the formatting
    # it will probably break the formatting if you have 100+ roles
    if roles_len_string > 1:
        roles_count_offset -= 2

    pad_roles_by = roles_count_offset + roles_len_string + roles_label_len

    roles = field_value(total_roles, "roles", "normal", 0)
    defaults = field_value(report["defaults"], "defaults", "blue", 16)
    facts = field_value(report["facts"], "facts", "purple", 16)
    files = field_value(report["files"], "files", "dark gray", 16)
    lines = field_value(report["lines"], "lines", "normal", 16)

    print "".join(clr.stringc("-", "black") * 79)
    print "{0} {2:>{1}} {3} {4} {5}".format(
        roles, pad_roles_by, defaults, facts, files, lines)
581640
function ( number, pluralRules ) {
			var i,
				pluralForms = [ 'zero', 'one', 'two', 'few', 'many', 'other' ],
				pluralFormIndex = 0;

			for ( i = 0; i < pluralForms.length; i++ ) {
				if ( pluralRules[pluralForms[i]] ) {
					if ( pluralRuleParser( pluralRules[pluralForms[i]], number ) ) {
						return pluralFormIndex;
					}

					pluralFormIndex++;
				}
			}

			return pluralFormIndex;
		}
1145961
private List<String> parseReference(String reference) {
		List<String> references = new ArrayList<String>();
		Matcher matcher = REFERENCE_PATTERN.matcher(reference);
		while (matcher.find()) {
			references.add(matcher.group(1));
		}
		return references;
	}
868908
function seq() {
  var parsers = [].slice.call(arguments);
  var numParsers = parsers.length;
  for (var j = 0; j < numParsers; j += 1) {
    assertParser(parsers[j]);
  }
  return Parsimmon(function(input, i) {
    var result;
    var accum = new Array(numParsers);
    for (var j = 0; j < numParsers; j += 1) {
      result = mergeReplies(parsers[j]._(input, i), result);
      if (!result.status) {
        return result;
      }
      accum[j] = result.value;
      i = result.index;
    }
    return mergeReplies(makeSuccess(i, accum), result);
  });
}
309360
function formatter (results) {
  const warnings = []
  const errors = []

  results.forEach(result => {
    if (!result.warnings.length) {
      errors.push(result)
      return
    }

    const warningMessages = []
    const errorMessages = []

    result.warnings.forEach(message => {
      if (message.severity === 'warning') {
        warningMessages.push(message)
      } else {
        errorMessages.push(message)
      }
    })

    warnings.push(Object.assign({}, result, { warnings: warningMessages }))
    errors.push(Object.assign({}, result, { warnings: errorMessages }))
  })

  return stringFormatter([].concat(warnings, errors))
}
60390
function () {
    var tmp_0 = this.get(2,2) * this.get(3,3);
    var tmp_1 = this.get(3,2) * this.get(2,3);
    var tmp_2 = this.get(1,2) * this.get(3,3);
    var tmp_3 = this.get(3,2) * this.get(1,3);
    var tmp_4 = this.get(1,2) * this.get(2,3);
    var tmp_5 = this.get(2,2) * this.get(1,3);
    var tmp_6 = this.get(0,2) * this.get(3,3);
    var tmp_7 = this.get(3,2) * this.get(0,3);
    var tmp_8 = this.get(0,2) * this.get(2,3);
    var tmp_9 = this.get(2,2) * this.get(0,3);
    var tmp_10 = this.get(0,2) * this.get(1,3);
    var tmp_11 = this.get(1,2) * this.get(0,3);
    var tmp_12 = this.get(2,0) * this.get(3,1);
    var tmp_13 = this.get(3,0) * this.get(2,1);
    var tmp_14 = this.get(1,0) * this.get(3,1);
    var tmp_15 = this.get(3,0) * this.get(1,1);
    var tmp_16 = this.get(1,0) * this.get(2,1);
    var tmp_17 = this.get(2,0) * this.get(1,1);
    var tmp_18 = this.get(0,0) * this.get(3,1);
    var tmp_19 = this.get(3,0) * this.get(0,1);
    var tmp_20 = this.get(0,0) * this.get(2,1);
    var tmp_21 = this.get(2,0) * this.get(0,1);
    var tmp_22 = this.get(0,0) * this.get(1,1);
    var tmp_23 = this.get(1,0) * this.get(0,1);

    var t0 = ((tmp_0 * this.get(1,1) + tmp_3 * this.get(2,1) + tmp_4 * this.get(3,1)) -
              (tmp_1 * this.get(1,1) + tmp_2 * this.get(2,1) + tmp_5 * this.get(3,1)));
    var t1 = ((tmp_1 * this.get(0,1) + tmp_6 * this.get(2,1) + tmp_9 * this.get(3,1)) -
              (tmp_0 * this.get(0,1) + tmp_7 * this.get(2,1) + tmp_8 * this.get(3,1)));
    var t2 = ((tmp_2 * this.get(0,1) + tmp_7 * this.get(1,1) + tmp_10 * this.get(3,1)) -
              (tmp_3 * this.get(0,1) + tmp_6 * this.get(1,1) + tmp_11 * this.get(3,1)));
    var t3 = ((tmp_5 * this.get(0,1) + tmp_8 * this.get(1,1) + tmp_11 * this.get(2,1)) -
              (tmp_4 * this.get(0,1) + tmp_9 * this.get(1,1) + tmp_10 * this.get(2,1)));

    var d = 1.0 / (this.get(0,0) * t0 + this.get(1,0) * t1 + this.get(2,0) * t2 + this.get(3,0) * t3);

    var out_00 = d * t0;
    var out_01 = d * t1;
    var out_02 = d * t2;
    var out_03 = d * t3;

    var out_10 = d * ((tmp_1 * this.get(1,0) + tmp_2 * this.get(2,0) + tmp_5 * this.get(3,0)) -
                      (tmp_0 * this.get(1,0) + tmp_3 * this.get(2,0) + tmp_4 * this.get(3,0)));
    var out_11 = d * ((tmp_0 * this.get(0,0) + tmp_7 * this.get(2,0) + tmp_8 * this.get(3,0)) -
                      (tmp_1 * this.get(0,0) + tmp_6 * this.get(2,0) + tmp_9 * this.get(3,0)));
    var out_12 = d * ((tmp_3 * this.get(0,0) + tmp_6 * this.get(1,0) + tmp_11 * this.get(3,0)) -
                      (tmp_2 * this.get(0,0) + tmp_7 * this.get(1,0) + tmp_10 * this.get(3,0)));
    var out_13 = d * ((tmp_4 * this.get(0,0) + tmp_9 * this.get(1,0) + tmp_10 * this.get(2,0)) -
                      (tmp_5 * this.get(0,0) + tmp_8 * this.get(1,0) + tmp_11 * this.get(2,0)));

    var out_20 = d * ((tmp_12 * this.get(1,3) + tmp_15 * this.get(2,3) + tmp_16 * this.get(3,3)) -
                      (tmp_13 * this.get(1,3) + tmp_14 * this.get(2,3) + tmp_17 * this.get(3,3)));
    var out_21 = d * ((tmp_13 * this.get(0,3) + tmp_18 * this.get(2,3) + tmp_21 * this.get(3,3)) -
                      (tmp_12 * this.get(0,3) + tmp_19 * this.get(2,3) + tmp_20 * this.get(3,3)));
    var out_22 = d * ((tmp_14 * this.get(0,3) + tmp_19 * this.get(1,3) + tmp_22 * this.get(3,3)) -
                      (tmp_15 * this.get(0,3) + tmp_18 * this.get(1,3) + tmp_23 * this.get(3,3)));
    var out_23 = d * ((tmp_17 * this.get(0,3) + tmp_20 * this.get(1,3) + tmp_23 * this.get(2,3)) -
                      (tmp_16 * this.get(0,3) + tmp_21 * this.get(1,3) + tmp_22 * this.get(2,3)));
    
    var out_30 = d * ((tmp_14 * this.get(2,2) + tmp_17 * this.get(3,2) + tmp_13 * this.get(1,2)) -
                      (tmp_16 * this.get(3,2) + tmp_12 * this.get(1,2) + tmp_15 * this.get(2,2)));
    var out_31 = d * ((tmp_20 * this.get(3,2) + tmp_12 * this.get(0,2) + tmp_19 * this.get(2,2)) -
                      (tmp_18 * this.get(2,2) + tmp_21 * this.get(3,2) + tmp_13 * this.get(0,2)));
    var out_32 = d * ((tmp_18 * this.get(1,2) + tmp_23 * this.get(3,2) + tmp_15 * this.get(0,2)) -
                      (tmp_22 * this.get(3,2) + tmp_14 * this.get(0,2) + tmp_19 * this.get(1,2)));
    var out_33 = d * ((tmp_22 * this.get(2,2) + tmp_16 * this.get(0,2) + tmp_21 * this.get(1,2)) -
                      (tmp_20 * this.get(1,2) + tmp_23 * this.get(2,2) + tmp_17 * this.get(0,2)));

    this.elements[0*4+0] = out_00;
    this.elements[0*4+1] = out_01;
    this.elements[0*4+2] = out_02;
    this.elements[0*4+3] = out_03;
    this.elements[1*4+0] = out_10;
    this.elements[1*4+1] = out_11;
    this.elements[1*4+2] = out_12;
    this.elements[1*4+3] = out_13;
    this.elements[2*4+0] = out_20;
    this.elements[2*4+1] = out_21;
    this.elements[2*4+2] = out_22;
    this.elements[2*4+3] = out_23;
    this.elements[3*4+0] = out_30;
    this.elements[3*4+1] = out_31;
    this.elements[3*4+2] = out_32;
    this.elements[3*4+3] = out_33;
    return this;
  }
201094
def BuildReportLine(key, value, offset=None):
    
    reportline = "# " + key.ljust(20) + " : "

    if offset is None:
        return reportline + str(value)

    try:
        try:
            v=int(value)
            return reportline + "%*s" % (offset, str(value))
        except:
            pass
        v = float(value)
        return reportline + "%*s" % (offset - 1 + len(str(value)), str(value))
    except:
        return reportline + "%*s" % (offset - 1 + len(value), value)
155477
def []=(key, value)
      normalized_key = normalized_key(key)

      if key.is_a?(SymbolOperator)
        operator = :"$#{key.operator}"
        normalized_value = normalized_value(normalized_key, operator, value)
        @source[normalized_key] ||= {}
        @source[normalized_key][operator] = normalized_value
      else
        if key == :conditions
          value.each { |k, v| self[k] = v }
        else
          normalized_value = normalized_value(normalized_key, normalized_key, value)
          @source[normalized_key] = normalized_value
        end
      end
    end
950129
function format(obj, opts, fn) {
  if (typeof opts === 'function') {
    fn = opts; opts = {};
  }

  opts = opts || {};
  if (Array.isArray(opts.filter) || typeof opts.filter === 'string') {
    obj = filter(obj, opts.filter);
  }

  var keys = Object.keys(obj);
  var len = keys.length, i = 0;
  var str = '';
  var total = len;

  while (len--) {
    var fp = keys[i++];
    var ctx = context(read(fp), fn);
    var name = basename(fp);
    str += heading(name, fp);

    var list = obj[fp];
    var methods = Object.keys(list);
    total += methods.length;

    str += listify(fp, methods, ctx);
  }

  var res = {};
  res.list = str;
  res.total = total;
  return res;
}
316584
def pair_strings_sum_formatter(a, b):
  
  if b[:1] == "-":
    return "{0} - {1}".format(a, b[1:])
  return "{0} + {1}".format(a, b)
505464
function report (results) {
  const arr = []

  results.forEach(result => {
    const name = result.name
    const output = result.output
    const success = result.success

    arr.push('\n')
    arr.push(`${chalk.bold(`> ${name}:`)}\n`)
    arr.push('\n')

    if (success && !output.trim()) {
      arr.push(padding(passedMessage))
    } else {
      arr.push(padding(output))
    }

    arr.push('\n')
  })

  arr.push('\n')

  return reduceEmptyLine(arr.join(''))
}
699050
def _format_ret(self, full_ret):
        '''
        
        '''
        ret = {}
        out = ''
        retcode = 0
        for key, data in six.iteritems(full_ret):
            ret[key] = data['ret']
            if 'out' in data:
                out = data['out']
            ret_retcode = self._get_retcode(data)
            if ret_retcode > retcode:
                retcode = ret_retcode
        return ret, out, retcode
924221
function(param_, test) {
  var param = param_.replace(/\s+/g, '')
    , cap;

  if (param === 'even') {
    param = '2n+0';
  } else if (param === 'odd') {
    param = '2n+1';
  } else if (param.indexOf('n') === -1) {
    param = '0n' + param;
  }

  cap = /^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(param);

  return {
    group: cap[1] === '-'
      ? -(cap[2] || 1)
      : +(cap[2] || 1),
    offset: cap[4]
      ? (cap[3] === '-' ? -cap[4] : +cap[4])
      : 0
  };
}
536055
def _at_each(self, calculator, rule, scope, block):
        
        varstring, _, valuestring = block.argument.partition(' in ')
        values = calculator.calculate(valuestring)
        if not values:
            return

        varlist = [
            normalize_var(calculator.do_glob_math(var.strip()))
            # TODO use list parsing here
            for var in varstring.split(",")
        ]

        # `@each $foo, in $bar` unpacks, but `@each $foo in $bar` does not!
        unpack = len(varlist) > 1
        if not varlist[-1]:
            varlist.pop()

        inner_rule = rule.copy()
        inner_rule.unparsed_contents = block.unparsed_contents
        if not self.should_scope_loop_in_rule(inner_rule):
            # DEVIATION: Allow not creating a new namespace
            inner_rule.namespace = rule.namespace

        for v in List.from_maybe(values):
            if unpack:
                v = List.from_maybe(v)
                for i, var in enumerate(varlist):
                    if i >= len(v):
                        value = Null()
                    else:
                        value = v[i]
                    inner_rule.namespace.set_variable(var, value)
            else:
                inner_rule.namespace.set_variable(varlist[0], v)
            self.manage_children(inner_rule, scope)
175476
def _compose_range(pattern, rule, fill=2):
    
    keys = []
    mask = len(pattern)
    for rule in str.split(rule, ","):
        if not '-' in rule:
            if rule[:mask] == pattern:
                keys.append(rule[mask:])
            else:
                keys.append(rule)
        else:
            (start, end) = str.split(rule, '-')
            if rule[:mask] == pattern:
                start = int(start[mask:])
            else:
                start = int(start)
            # Since I allow both "Week00-15" and "Week00-Week15", I need
            # to check for the second week.
            if end[0:mask] == pattern:
                end = int(end[mask:])
            else:
                end = int(end)

            key = "%%0%ii" % fill
            for i in range(start, end + 1):
                keys.append(key % i)

    #print keys
    return keys
191956
def []=(key, value)
      if value
        ffi_delegate.set_meta(key, "%s", :string, value)
      else
        ffi_delegate.unset_meta(key)
      end
    end