Subscript handling -- one of the tricky parts.
185341
def on_subscript(self, node):    # ('value', 'slice', 'ctx')
        """"""
        val = self.run(node.value)
        nslice = self.run(node.slice)
        ctx = node.ctx.__class__
        if ctx in (ast.Load, ast.Store):
            if isinstance(node.slice, (ast.Index, ast.Slice, ast.Ellipsis)):
                return val.__getitem__(nslice)
            elif isinstance(node.slice, ast.ExtSlice):
                return val[nslice]
        else:
            msg = "subscript with unknown context"
            self.raise_exception(node, msg=msg)
1022770
def sub(self, *args, **kwargs):
        
        return self._apply(operator.sub, *args, **kwargs)
519609
def join_and(value):
    
    # convert numbers to strings
    value = [str(item) for item in value]

    if len(value) == 1:
        return value[0]
    if len(value) == 2:
        return "%s and %s" % (value[0], value[1])

    # join all but the last element
    all_but_last = ", ".join(value[:-1])
    return "%s and %s" % (all_but_last, value[-1])
294026
function subBytes()
    {

        for ($i = 0; $i < 4; $i++) {
            for ($j = 0; $j < $this->Nb; $j++) $this->s[$i][$j] = $this->sBox[$this->s[$i][$j]];
        }
    }
316891
function assertSubstrings(str, substrings) {
  substrings.forEach(function(substring) {
    assert(str.indexOf(substring) !== -1, str +
      ' - string does not contain: ' + substring);
  });
}
393743
def substitute(self, text, subvars={},
                   checkmissing=None):
        ''''''

        if checkmissing is None:
            checkmissing = self.checkmissing

        while True:
            idx = text.find(self.start_var_token)
            if idx == -1:
                return text
            endidx = text[idx:].find(self.end_var_token)
            if endidx == -1:
                raise MAVSubstituteError('missing end of variable: %s' % text[idx:idx+10])
            varname = text[idx+2:idx+endidx]
            fullvar = varname

            # allow default value after a :
            def_value = None
            colon = varname.find(':')
            if colon != -1:
                def_value = varname[colon+1:]
                varname = varname[:colon]

            if varname in subvars:
                value = subvars[varname]
            elif def_value is not None:
                value = def_value
            elif checkmissing:
                raise MAVSubstituteError("unknown variable in '%s%s%s'" % (
                    self.start_var_token, varname, self.end_var_token))
            else:
                return text[0:idx+endidx] + self.substitute(text[idx+endidx:], subvars, checkmissing=False)
            text = text.replace("%s%s%s" % (self.start_var_token, fullvar, self.end_var_token), str(value))
        return text
216291
private static CharSequence js_substr(CharSequence target, Object[] args) {
        if (args.length < 1)
            return target;

        double begin = ScriptRuntime.toInteger(args[0]);
        double end;
        int length = target.length();

        if (begin < 0) {
            begin += length;
            if (begin < 0)
                begin = 0;
        } else if (begin > length) {
            begin = length;
        }

        if (args.length == 1) {
            end = length;
        } else {
            end = ScriptRuntime.toInteger(args[1]);
            if (end < 0)
                end = 0;
            end += begin;
            if (end > length)
                end = length;
        }

        return target.subSequence((int)begin, (int)end);
    }
239507
function handleEscaping(tokens, token, index) {
	if (index === 0) {
		return [token];
	}

	const previousToken = tokens[index - 1];

	if (!previousToken.endsWith('\\')) {
		return [...tokens, token];
	}

	return [...tokens.slice(0, index - 1), `${previousToken.slice(0, -1)} ${token}`];
}
561850
def _operator_handling(self, cursor):
        """"""
        values = self._literal_handling(cursor)
        retval = ''.join([str(val) for val in values])
        return retval
339586
function trimString(s) {
  let l = 0;
  let r = s.length - 1;
  while (l < s.length && s[l] === ' ') {
    l++;
  }
  while (r > l && s[r] === ' ') {
    r -= 1;
  }
  return s.substring(l, r + 1);
}
596799
function parseFloatOperand(reader) {
            var s = '';
            var eof = 15;
            var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'E', 'E-', null, '-'];

            while (true) {
                var b = reader.readUint8();
                var n1 = b >> 4;
                var n2 = b & 15;

                if (n1 === eof) {
                    break;
                }

                s += lookup[n1];

                if (n2 === eof) {
                    break;
                }

                s += lookup[n2];
            }

            return parseFloat(s);
        }
323575
def p_expr_include_once(p):
    ''
    p[0] = ast.Include(p[2], True, lineno=p.lineno(1))
738966
def invsubword(w):
    
    w = w.reshape(4, 8)
    return ISBOX[w[0]] + ISBOX[w[1]] + ISBOX[w[2]] + ISBOX[w[3]]
970784
function parse(formula) {
    formula = formula.trim().toLowerCase();

    if (formula === "even") {
        return [2, 0];
    } else if (formula === "odd") {
        return [2, 1];
    } else {
        var parsed = formula.match(re_nthElement);

        if (!parsed) {
            throw new SyntaxError(
                "n-th rule couldn't be parsed ('" + formula + "')"
            );
        }

        var a;

        if (parsed[1]) {
            a = parseInt(parsed[1], 10);
            if (isNaN(a)) {
                if (parsed[1].charAt(0) === "-") a = -1;
                else a = 1;
            }
        } else a = 0;

        return [a, parsed[3] ? parseInt((parsed[2] || "") + parsed[3], 10) : 0];
    }
}
82216
function prefix (a, b) {
  if(a.length > b.length) return false
  var l = a.length - 1
  var lastA = a[l]
  var lastB = b[l]

  if(typeof lastA !== typeof lastB)
    return false

  if('string' == typeof lastA
    && 0 != lastB.indexOf(lastA))
      return false
  
  //handle cas where there is no key prefix
  //(a hook on an entire sublevel)
  if(a.length == 1 && isArrayLike(lastA)) l ++
  
  while(l--) {
    if(compare(a[l], b[l])) return false
  }
  return true
}
932343
function subWord($w)
    {
        $temp = 0;
        // loop through 4 bytes of a word
        for ($i = 0; $i < 4; $i++) {
            $temp = $w >> 24; // put the first 8-bits into temp
            // Can't do unsigned shifts, so we need to make this temp positive
            $temp = ($temp < 0 ? (256 + $temp) : $temp);
            $w    <<= 8; // make room for the substituted byte in w;
            $this->make32BitWord($w);
            $w += $this->sBox[$temp]; // add the substituted byte back
        }
        $this->make32BitWord($w);

        return $w;
    }
400029
function sub (a, b, c) {
		binary_arithmetic.call(this, a, b, c, '__sub', sub_internal);
	}