andreax  + pts/0        2013-08-21 08:58   .         32341 (l26.box)
172053
def print_info(self):
        ""
        "           pts/34       2013-06-12 15:04             26396 id=s/34  term=0 exit=0"
#        if self.ut_type not in [6,7]:
#            return
        print("%-10s %-12s %15s %15s %-8s" % (
                    str_from_c(self.ut_user),
                    str_from_c(self.ut_line),
                    time.strftime("%Y-%m-%d %H:%M", time.gmtime(self.ut_tv.tv_sec)),
                    self.ut_pid,
                    str_from_c(self.ut_host) and "(%s)" % str_from_c(self.ut_host) or str_from_c(self.ut_id) and "id=%s" % str_from_c(self.ut_id) or ""))
591657
def ph2full(ptrans, htrans):
    
    n_pstates = len(ptrans)
    n_hstates = len(htrans[0, 0])
    N = n_pstates * n_hstates
    trans = np.zeros((N, N))
    for pidx in range(n_pstates):
        for hidx in range(n_hstates):
            trans[pidx * n_hstates + hidx] = (ptrans[pidx, :, np.newaxis] * htrans[pidx, :, hidx]).flatten()

    return trans
744842
int /* udword_ppt */readBEdword(final short[] /* ubyte_ppt[4] */ptr,
			int pos) {
		return (((((short /* udword_ppt */) ptr[pos + 0]) << 24)
				+ (((short /* udword_ppt */) ptr[pos + 1]) << 16)
				+ (((short /* udword_ppt */) ptr[pos + 2]) << 8) + ((short /* udword_ppt */) ptr[pos + 3])) << 0);
	}
301676
def i2osp(self, long_integer, block_size):
        ''
        hex_string = '%X' % long_integer
        if len(hex_string) > 2 * block_size:
            raise ValueError('integer %i too large to encode in %i octets' % (long_integer, block_size))
        return a2b_hex(hex_string.zfill(2 * block_size))
143142
def base36(value):
    
    result = ''
    while value:
        value, i = divmod(value, 36)
        result = BASE36_ALPHABET[i] + result
    return result
277276
def in6_getLocalUniquePrefix():
    
    # Extracted from RFC 1305 (NTP) :
    # NTP timestamps are represented as a 64-bit unsigned fixed-point number,
    # in seconds relative to 0h on 1 January 1900. The integer part is in the
    # first 32 bits and the fraction part in the last 32 bits.

    # epoch = (1900, 1, 1, 0, 0, 0, 5, 1, 0)
    # x = time.time()
    # from time import gmtime, strftime, gmtime, mktime
    # delta = mktime(gmtime(0)) - mktime(self.epoch)
    # x = x-delta

    tod = time.time()  # time of day. Will bother with epoch later
    i = int(tod)
    j = int((tod - i) * (2**32))
    tod = struct.pack("!II", i, j)
    mac = RandMAC()
    # construct modified EUI-64 ID
    eui64 = inet_pton(socket.AF_INET6, '::' + in6_mactoifaceid(mac))[8:]
    import hashlib
    globalid = hashlib.sha1(tod + eui64).digest()[:5]
    return inet_ntop(socket.AF_INET6, b'\xfd' + globalid + b'\x00' * 10)
251739
def padto8(data):
    """"""
    length = len(data)
    return data + b'\xdb' * (roundto8(length) - length)
1096647
function toLatLng()
	{
		$airy1830 = new ReferenceEllipsoid;
		$OSGB_F0  = 0.9996012717;
		$N0       = -100000.0;
		$E0       = 400000.0;
		$phi0     = deg2rad(49.0);
		$lambda0  = deg2rad(-2.0);
		$a        = $airy1830->maj;
		$b        = $airy1830->min;
		$eSquared = $airy1830->ecc;
		$phi      = 0.0;
		$lambda   = 0.0;
		$E        = $this->easting;
		$N        = $this->northing;
		$n        = ($a - $b) / ($a + $b);
		$M        = 0.0;
		$phiPrime = (($N - $N0) / ($a * $OSGB_F0)) + $phi0;

		$phiPrimeSecant     = Trig::sec($phiPrime);
		$phiPrimeSinSquared = Trig::sinSquared($phiPrime);
		$phiPrimeTanSquared = Trig::tanSquared($phiPrime);

		do {
			$M =
				($b * $OSGB_F0)
				* (((1 + $n + ((5.0 / 4.0) * $n * $n) + ((5.0 / 4.0) * $n * $n * $n))
					* ($phiPrime - $phi0))
					- (((3 * $n) + (3 * $n * $n) + ((21.0 / 8.0) * $n * $n * $n))
					* sin($phiPrime - $phi0)
					* cos($phiPrime + $phi0))
					+ ((((15.0 / 8.0) * $n * $n) + ((15.0 / 8.0) * $n * $n * $n))
					* sin(2.0 * ($phiPrime - $phi0))
					* cos(2.0 * ($phiPrime + $phi0)))
					- (((35.0 / 24.0) * $n * $n * $n)
					* sin(3.0 * ($phiPrime - $phi0))
					* cos(3.0 * ($phiPrime + $phi0))));
			$phiPrime += ($N - $N0 - $M) / ($a * $OSGB_F0);
		} while (($N - $N0 - $M) >= 0.001);

		$v = $a * $OSGB_F0 * pow(1.0 - $eSquared * $phiPrimeSinSquared, -0.5);

		$rho = $a
			* $OSGB_F0
			* (1.0 - $eSquared)
			* pow(1.0 - $eSquared * $phiPrimeSinSquared, -1.5);

		$etaSquared = ($v / $rho) - 1.0;

		$VII = tan($phiPrime) / (2 * $rho * $v);

		$VIII = (tan($phiPrime) / (24.0 * $rho * pow($v, 3.0)))
			* (5.0
			+ (3.0 * $phiPrimeTanSquared)
			+ $etaSquared
			- (9.0 * $phiPrimeTanSquared * $etaSquared));

		$IX = (tan($phiPrime) / (720.0 * $rho * pow($v, 5.0)))
			* (61.0
			+ (90.0 * $phiPrimeTanSquared)
			+ (45.0 * $phiPrimeTanSquared * $phiPrimeTanSquared));

		$X = $phiPrimeSecant / $v;

		$XI = ($phiPrimeSecant / (6.0 * $v * $v * $v))
			* (($v / $rho) + (2 * $phiPrimeTanSquared));

		$XII = ($phiPrimeSecant / (120.0 * pow($v, 5.0)))
			* (5.0
			+ (28.0 * $phiPrimeTanSquared)
			+ (24.0 * $phiPrimeTanSquared * $phiPrimeTanSquared));

		$XIIA = ($phiPrimeSecant / (5040.0 * pow($v, 7.0)))
			* (61.0
			+ (662.0 * $phiPrimeTanSquared)
			+ (1320.0 * $phiPrimeTanSquared * $phiPrimeTanSquared)
			+ (720.0
				* $phiPrimeTanSquared
				* $phiPrimeTanSquared
				* $phiPrimeTanSquared));

		$phi = $phiPrime
			- ($VII * pow($E - $E0, 2.0))
			+ ($VIII * pow($E - $E0, 4.0))
			- ($IX * pow($E - $E0, 6.0));

		$lambda = $lambda0
			+ ($X * ($E - $E0))
			- ($XI * pow($E - $E0, 3.0))
			+ ($XII * pow($E - $E0, 5.0))
			- ($XIIA * pow($E - $E0, 7.0));

		return new LatLng(rad2deg($phi), rad2deg($lambda));
	}
1081517
function () {
				return {
					width: bBox.width + 2 * padding,
					height: bBox.height + 2 * padding,
					x: bBox.x - padding,
					y: bBox.y - padding
				};
			}
350867
def bbox_pred(boxes, box_deltas, box_stds):
    
    if boxes.shape[0] == 0:
        return np.zeros((0, box_deltas.shape[1]))

    widths = boxes[:, 2] - boxes[:, 0] + 1.0
    heights = boxes[:, 3] - boxes[:, 1] + 1.0
    ctr_x = boxes[:, 0] + 0.5 * (widths - 1.0)
    ctr_y = boxes[:, 1] + 0.5 * (heights - 1.0)

    dx = box_deltas[:, 0::4] * box_stds[0]
    dy = box_deltas[:, 1::4] * box_stds[1]
    dw = box_deltas[:, 2::4] * box_stds[2]
    dh = box_deltas[:, 3::4] * box_stds[3]

    pred_ctr_x = dx * widths[:, np.newaxis] + ctr_x[:, np.newaxis]
    pred_ctr_y = dy * heights[:, np.newaxis] + ctr_y[:, np.newaxis]
    pred_w = np.exp(dw) * widths[:, np.newaxis]
    pred_h = np.exp(dh) * heights[:, np.newaxis]

    pred_boxes = np.zeros(box_deltas.shape)
    # x1
    pred_boxes[:, 0::4] = pred_ctr_x - 0.5 * (pred_w - 1.0)
    # y1
    pred_boxes[:, 1::4] = pred_ctr_y - 0.5 * (pred_h - 1.0)
    # x2
    pred_boxes[:, 2::4] = pred_ctr_x + 0.5 * (pred_w - 1.0)
    # y2
    pred_boxes[:, 3::4] = pred_ctr_y + 0.5 * (pred_h - 1.0)

    return pred_boxes
96892
function(x,y){
        x[y>>5] |= 0x80<<((y)%32);
        x[(((y+64)>>>9)<<4)+14] = y;
        var a = 1732584193,
            b = -271733879,
            c = -1732584194,
            d = 271733878;
        for(var i=0,l=x.length,_oa,_ob,_oc,_od;i<l;i+=16){
            _oa = a; _ob = b; _oc = c; _od = d;
            a = __md5ff(a, b, c, d, x[i+ 0], 7 , -680876936);
            d = __md5ff(d, a, b, c, x[i+ 1], 12, -389564586);
            c = __md5ff(c, d, a, b, x[i+ 2], 17,  606105819);
            b = __md5ff(b, c, d, a, x[i+ 3], 22, -1044525330);
            a = __md5ff(a, b, c, d, x[i+ 4], 7 , -176418897);
            d = __md5ff(d, a, b, c, x[i+ 5], 12,  1200080426);
            c = __md5ff(c, d, a, b, x[i+ 6], 17, -1473231341);
            b = __md5ff(b, c, d, a, x[i+ 7], 22, -45705983);
            a = __md5ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
            d = __md5ff(d, a, b, c, x[i+ 9], 12, -1958414417);
            c = __md5ff(c, d, a, b, x[i+10], 17, -42063);
            b = __md5ff(b, c, d, a, x[i+11], 22, -1990404162);
            a = __md5ff(a, b, c, d, x[i+12], 7 ,  1804603682);
            d = __md5ff(d, a, b, c, x[i+13], 12, -40341101);
            c = __md5ff(c, d, a, b, x[i+14], 17, -1502002290);
            b = __md5ff(b, c, d, a, x[i+15], 22,  1236535329);
            a = __md5gg(a, b, c, d, x[i+ 1], 5 , -165796510);
            d = __md5gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
            c = __md5gg(c, d, a, b, x[i+11], 14,  643717713);
            b = __md5gg(b, c, d, a, x[i+ 0], 20, -373897302);
            a = __md5gg(a, b, c, d, x[i+ 5], 5 , -701558691);
            d = __md5gg(d, a, b, c, x[i+10], 9 ,  38016083);
            c = __md5gg(c, d, a, b, x[i+15], 14, -660478335);
            b = __md5gg(b, c, d, a, x[i+ 4], 20, -405537848);
            a = __md5gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
            d = __md5gg(d, a, b, c, x[i+14], 9 , -1019803690);
            c = __md5gg(c, d, a, b, x[i+ 3], 14, -187363961);
            b = __md5gg(b, c, d, a, x[i+ 8], 20,  1163531501);
            a = __md5gg(a, b, c, d, x[i+13], 5 , -1444681467);
            d = __md5gg(d, a, b, c, x[i+ 2], 9 , -51403784);
            c = __md5gg(c, d, a, b, x[i+ 7], 14,  1735328473);
            b = __md5gg(b, c, d, a, x[i+12], 20, -1926607734);
            a = __md5hh(a, b, c, d, x[i+ 5], 4 , -378558);
            d = __md5hh(d, a, b, c, x[i+ 8], 11, -2022574463);
            c = __md5hh(c, d, a, b, x[i+11], 16,  1839030562);
            b = __md5hh(b, c, d, a, x[i+14], 23, -35309556);
            a = __md5hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
            d = __md5hh(d, a, b, c, x[i+ 4], 11,  1272893353);
            c = __md5hh(c, d, a, b, x[i+ 7], 16, -155497632);
            b = __md5hh(b, c, d, a, x[i+10], 23, -1094730640);
            a = __md5hh(a, b, c, d, x[i+13], 4 ,  681279174);
            d = __md5hh(d, a, b, c, x[i+ 0], 11, -358537222);
            c = __md5hh(c, d, a, b, x[i+ 3], 16, -722521979);
            b = __md5hh(b, c, d, a, x[i+ 6], 23,  76029189);
            a = __md5hh(a, b, c, d, x[i+ 9], 4 , -640364487);
            d = __md5hh(d, a, b, c, x[i+12], 11, -421815835);
            c = __md5hh(c, d, a, b, x[i+15], 16,  530742520);
            b = __md5hh(b, c, d, a, x[i+ 2], 23, -995338651);
            a = __md5ii(a, b, c, d, x[i+ 0], 6 , -198630844);
            d = __md5ii(d, a, b, c, x[i+ 7], 10,  1126891415);
            c = __md5ii(c, d, a, b, x[i+14], 15, -1416354905);
            b = __md5ii(b, c, d, a, x[i+ 5], 21, -57434055);
            a = __md5ii(a, b, c, d, x[i+12], 6 ,  1700485571);
            d = __md5ii(d, a, b, c, x[i+ 3], 10, -1894986606);
            c = __md5ii(c, d, a, b, x[i+10], 15, -1051523);
            b = __md5ii(b, c, d, a, x[i+ 1], 21, -2054922799);
            a = __md5ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
            d = __md5ii(d, a, b, c, x[i+15], 10, -30611744);
            c = __md5ii(c, d, a, b, x[i+ 6], 15, -1560198380);
            b = __md5ii(b, c, d, a, x[i+13], 21,  1309151649);
            a = __md5ii(a, b, c, d, x[i+ 4], 6 , -145523070);
            d = __md5ii(d, a, b, c, x[i+11], 10, -1120210379);
            c = __md5ii(c, d, a, b, x[i+ 2], 15,  718787259);
            b = __md5ii(b, c, d, a, x[i+ 9], 21, -343485551);
            a = __add(a, _oa);
            b = __add(b, _ob);
            c = __add(c, _oc);
            d = __add(d, _od);
        }   return [a, b, c, d];
    }
96155
function bnpToRadix(b) {
    if (b == null) b = 10;
    if (this.signum() === 0 || b < 2 || b > 36) return "0";
    var cs = this.chunkSize(b);
    var a = Math.pow(b, cs);
    var d = nbv(a), y = nbi(), z = nbi(), r = "";
    this.divRemTo(d, y, z);
    while (y.signum() > 0) {
        r = (a + z.intValue()).toString(b).substr(1) + r;
        y.divRemTo(d, y, z);
    }
    return z.intValue().toString(b) + r;
}
21188
def bintoihex(buf, spos=0x0000):
    """"""
    c = 0
    olen = len(buf)
    ret = ""
    # 16 byte lines
    while (c+0x10) <= olen:
        adr = c + spos
        l = ':10{0:04X}00'.format(adr)
        sum = 0x10+((adr>>8)&M8)+(adr&M8)
        for j in range(0,0x10):
            nb = buf[c+j]
            l += '{0:02X}'.format(nb)
            sum = (sum + nb)&M8
        l += '{0:02X}'.format((~sum+1)&M8)
        ret += l + '\n'
        c += 0x10
    # remainder
    if c < olen:
        rem = olen-c
        sum = rem
        adr = c + spos
        l = ':{0:02X}{1:04X}00'.format(rem,adr)   # rem < 0x10
        sum += ((adr>>8)&M8)+(adr&M8)
        for j in range(0,rem):
            nb = buf[c+j]
            l += '{0:02X}'.format(nb)
            sum = (sum + nb)&M8
        l += '{0:02X}'.format((~sum+1)&M8)
        ret += l + '\n'
    ret += ':00000001FF\n'        # EOF
    return ret
1028171
def glob7s(p, Input, flags):
    '''

 '''
    pset = 2.0
    t = [0.0]*14
    dr=1.72142E-2;
    dgtr=1.74533E-2;

    #/* confirm parameter set */
    if (p[99]==0): # pragma: no cover
        p[99]=pset;
    
    #for j in range(14):    #Already taken care of
    #    t[j]=0.0;
    cd32 = cos(dr*(Input.doy-p[31]));
    cd18 = cos(2.0*dr*(Input.doy-p[17]));
    cd14 = cos(dr*(Input.doy-p[13]));
    cd39 = cos(2.0*dr*(Input.doy-p[38]));
    p32=p[31];
    p18=p[17];
    p14=p[13];
    p39=p[38];

    #/* F10.7 */
    t[0] = p[21]*dfa;

    #/* time independent */
    t[1]=p[1]*plg[0][2] + p[2]*plg[0][4] + p[22]*plg[0][6] + p[26]*plg[0][1] + p[14]*plg[0][3] + p[59]*plg[0][5];

    #/* SYMMETRICAL ANNUAL */
    t[2]=(p[18]+p[47]*plg[0][2]+p[29]*plg[0][4])*cd32;

    #/* SYMMETRICAL SEMIANNUAL */
    t[3]=(p[15]+p[16]*plg[0][2]+p[30]*plg[0][4])*cd18;

    #/* ASYMMETRICAL ANNUAL */
    t[4]=(p[9]*plg[0][1]+p[10]*plg[0][3]+p[20]*plg[0][5])*cd14;

    #/* ASYMMETRICAL SEMIANNUAL */
    t[5]=(p[37]*plg[0][1])*cd39;

    #/* DIURNAL */
    if (flags.sw[7]):
        t71 = p[11]*plg[1][2]*cd14*flags.swc[5];
        t72 = p[12]*plg[1][2]*cd14*flags.swc[5];
        t[6] = ((p[3]*plg[1][1] + p[4]*plg[1][3] + t71) * ctloc + (p[6]*plg[1][1] + p[7]*plg[1][3] + t72) * stloc) ;
    

    #/* SEMIDIURNAL */
    if (flags.sw[8]):
        t81 = (p[23]*plg[2][3]+p[35]*plg[2][5])*cd14*flags.swc[5];
        t82 = (p[33]*plg[2][3]+p[36]*plg[2][5])*cd14*flags.swc[5];
        t[7] = ((p[5]*plg[2][2] + p[41]*plg[2][4] + t81) * c2tloc + (p[8]*plg[2][2] + p[42]*plg[2][4] + t82) * s2tloc);
    

    #/* TERDIURNAL */
    if (flags.sw[14]):
            t[13] = p[39] * plg[3][3] * s3tloc + p[40] * plg[3][3] * c3tloc;
    

    #/* MAGNETIC ACTIVITY */
    if (flags.sw[9]):
        if (flags.sw[9]==1):
            t[8] = apdf * (p[32] + p[45] * plg[0][2] * flags.swc[2]);
        if (flags.sw[9]==-1):	
            t[8]=(p[50]*apt[0] + p[96]*plg[0][2] * apt[0]*flags.swc[2]);
    

    #/* LONGITUDINAL */
    if ( not((flags.sw[10]==0) or (flags.sw[11]==0) or (Input.g_long<=-1000.0))):
            t[10] = (1.0 + plg[0][1]*(p[80]*flags.swc[5]*cos(dr*(Input.doy-p[81]))\
                    +p[85]*flags.swc[6]*cos(2.0*dr*(Input.doy-p[86])))\
                    +p[83]*flags.swc[3]*cos(dr*(Input.doy-p[84]))\
                    +p[87]*flags.swc[4]*cos(2.0*dr*(Input.doy-p[88])))\
                    *((p[64]*plg[1][2]+p[65]*plg[1][4]+p[66]*plg[1][6]\
                    +p[74]*plg[1][1]+p[75]*plg[1][3]+p[76]*plg[1][5]\
                    )*cos(dgtr*Input.g_long)\
                    +(p[90]*plg[1][2]+p[91]*plg[1][4]+p[92]*plg[1][6]\
                    +p[77]*plg[1][1]+p[78]*plg[1][3]+p[79]*plg[1][5]\
                    )*sin(dgtr*Input.g_long));
    
    tt=0;
    for i in range(14):
        tt+=abs(flags.sw[i+1])*t[i];
    return tt;
830197
function () {
                var b, c, captures, d, depth, high, i, l, low, q, t;

                function match(x) {
                    var r = x.exec(s), r1;
                    if (r) {
                        l = r[0].length;
                        r1 = r[1];
                        c = r1.charAt(0);
                        s = s.substr(l);
                        character += l;
                        from = character - r1.length;
                        return r1;
                    }
                }

                function string(x) {
                    var c, j, r = '';

                    if (jsonmode && x !== '"') {
                        warningAt("Strings must use doublequote.",
                                line, character);
                    }

                    if (xmode === x || xmode === 'string') {
                        return it('(punctuator)', x);
                    }

                    function esc(n) {
                        var i = parseInt(s.substr(j + 1, n), 16);
                        j += n;
                        if (i >= 32 && i <= 127 &&
                                i !== 34 && i !== 92 && i !== 39) {
                            warningAt("Unnecessary escapement.", line, character);
                        }
                        character += n;
                        c = String.fromCharCode(i);
                    }
                    j = 0;
                    for (;;) {
                        while (j >= s.length) {
                            j = 0;
                            if (xmode !== 'xml' || !nextLine()) {
                                errorAt("Unclosed string.", line, from);
                            }
                        }
                        c = s.charAt(j);
                        if (c === x) {
                            character += 1;
                            s = s.substr(j + 1);
                            return it('(string)', r, x);
                        }
                        if (c < ' ') {
                            if (c === '\n' || c === '\r') {
                                break;
                            }
                            warningAt("Control character in string: {a}.",
                                    line, character + j, s.slice(0, j));
                        } else if (c === '<') {
                            if (option.adsafe && xmode === 'xml') {
                                warningAt("ADsafe string violation.",
                                        line, character + j);
                            } else if (s.charAt(j + 1) === '/' && ((xmode && xmode !== 'CDATA') || option.adsafe)) {
                                warningAt("Expected '<\\/' and instead saw '</'.", line, character);
                            }
                        } else if (c === '\\') {
                            if (option.adsafe && xmode === 'xml') {
                                warningAt("ADsafe string violation.",
                                        line, character + j);
                            }
                            j += 1;
                            character += 1;
                            c = s.charAt(j);
                            switch (c) {
                            case '\\':
                            case '\'':
                            case '"':
                            case '/':
                                break;
                            case 'b':
                                c = '\b';
                                break;
                            case 'f':
                                c = '\f';
                                break;
                            case 'n':
                                c = '\n';
                                break;
                            case 'r':
                                c = '\r';
                                break;
                            case 't':
                                c = '\t';
                                break;
                            case 'u':
                                esc(4);
                                break;
                            case 'v':
                                c = '\v';
                                break;
                            case 'x':
                                if (jsonmode) {
                                    warningAt("Avoid \\x-.", line, character);
                                }
                                esc(2);
                                break;
                            default:
                                warningAt("Bad escapement.", line, character);
                            }
                        }
                        r += c;
                        character += 1;
                        j += 1;
                    }
                }

                for (;;) {
                    if (!s) {
                        return it(nextLine() ? '(endline)' : '(end)', '');
                    }
                    t = match(tx);
                    if (!t) {
                        t = '';
                        c = '';
                        while (s && s < '!') {
                            s = s.substr(1);
                        }
                        if (s) {
                            errorAt("Unexpected '{a}'.",
                                    line, character, s.substr(0, 1));
                        }
                    }

//      identifier

                    if (c.isAlpha() || c === '_' || c === '$') {
                        return it('(identifier)', t);
                    }

//      number

                    if (c.isDigit()) {
                        if (!isFinite(Number(t))) {
                            warningAt("Bad number '{a}'.",
                                line, character, t);
                        }
                        if (s.substr(0, 1).isAlpha()) {
                            warningAt("Missing space after '{a}'.",
                                    line, character, t);
                        }
                        if (c === '0') {
                            d = t.substr(1, 1);
                            if (d.isDigit()) {
                                warningAt("Don't use extra leading zeros '{a}'.",
                                        line, character, t);
                            } else if (jsonmode && (d === 'x' || d === 'X')) {
                                warningAt("Avoid 0x-. '{a}'.",
                                        line, character, t);
                            }
                        }
                        if (t.substr(t.length - 1) === '.') {
                            warningAt(
    "A trailing decimal point can be confused with a dot '{a}'.",
                                    line, character, t);
                        }
                        return it('(number)', t);
                    }

//      string

                    switch (t) {
                    case '"':
                    case "'":
                        return string(t);

//      // comment

                    case '//':
                        if (src || (xmode && !(xmode === 'script' || xmode === 'CDATA'))) {
                            warningAt("Unexpected comment.", line, character);
                        }
                        if (option.adsafe && ax.test(s)) {
                            warningAt("ADsafe comment violation.", line, character);
                        }
                        s = '';
                        break;

//      /* comment

                    case '/*':
                        if (src || (xmode && !(xmode === 'script' || xmode === 'CDATA'))) {
                            warningAt("Unexpected comment.", line, character);
                        }
                        if (option.adsafe && ax.test(s)) {
                            warningAt("ADsafe comment violation.", line, character);
                        }
                        for (;;) {
                            i = s.search(lx);
                            if (i >= 0) {
                                break;
                            }
                            if (!nextLine()) {
                                errorAt("Unclosed comment.", line, character);
                            } else {
                                if (option.adsafe && ax.test(s)) {
                                    warningAt("ADsafe comment violation.", line, character);
                                }
                            }
                        }
                        character += i + 2;
                        if (s.substr(i, 1) === '/') {
                            errorAt("Nested comment.", line, character);
                        }
                        s = s.substr(i + 2);
                        break;

//      /*global /*extern /*members /*jslint */

                    case '/*global':
                    case '/*extern':
                    case '/*members':
                    case '/*member':
                    case '/*jslint':
                    case '*/':
                        return {
                            value: t,
                            type: 'special',
                            line: line,
                            character: character,
                            from: from
                        };

                    case '':
                        break;
//      /
                    case '/':
                        if (prereg) {
                            depth = 0;
                            captures = 0;
                            l = 0;
                            for (;;) {
                                b = true;
                                c = s.charAt(l);
                                l += 1;
                                switch (c) {
                                case '':
                                    errorAt("Unclosed regular expression.", line, from);
                                    return;
                                case '/':
                                    if (depth > 0) {
                                        warningAt("Unescaped '{a}'.", line, from + l, '/');
                                    }
                                    c = s.substr(0, l - 1);
                                    if (s.charAt(l) === 'g') {
                                        l += 1;
                                    }
                                    if (s.charAt(l) === 'i') {
                                        l += 1;
                                    }
                                    if (s.charAt(l) === 'm') {
                                        l += 1;
                                    }
                                    character += l;
                                    s = s.substr(l);
                                    return it('(regex)', c);
                                case '\\':
                                    l += 1;
                                    break;
                                case '(':
                                    depth += 1;
                                    b = false;
                                    if (s.charAt(l) === '?') {
                                        l += 1;
                                        switch (s.charAt(l)) {
                                        case ':':
                                        case '=':
                                        case '!':
                                            l += 1;
                                            break;
                                        default:
                                            warningAt("Expected '{a}' and instead saw '{b}'.", line, from + l, ':', s.charAt(l));
                                        }
                                    } else {
                                        captures += 1;
                                    }
                                    break;
                                case ')':
                                    if (depth === 0) {
                                        warningAt("Unescaped '{a}'.", line, from + l, ')');
                                    } else {
                                        depth -= 1;
                                    }
                                    break;
                                case ' ':
                                    q = 1;
                                    while (s.charAt(l) === ' ') {
                                        l += 1;
                                        q += 1;
                                    }
                                    if (q > 1) {
                                        warningAt("Spaces are hard to count. Use {{a}}.", line, from + l, q);
                                    }
                                    break;
                                case '[':
                                    if (s.charAt(l) === '^') {
                                        l += 1;
                                    }
                                    q = false;
klass:                              for (;;) {
                                        c = s.charAt(l);
                                        l += 1;
                                        switch (c) {
                                        case '[':
                                        case '^':
                                            warningAt("Unescaped '{a}'.", line, from + l, c);
                                            q = true;
                                            break;
                                        case '-':
                                            if (q) {
                                                q = false;
                                            } else {
                                                warningAt("Unescaped '{a}'.", line, from + l, '-');
                                                q = true;
                                            }
                                            break;
                                        case ']':
                                            if (!q) {
                                                warningAt("Unescaped '{a}'.", line, from + l - 1, '-');
                                            }
                                            break klass;
                                        case '\\':
                                            l += 1;
                                            q = true;
                                            break;
                                        default:
                                            if (c < ' ') {
                                                errorAt(c ? "Control character in a regular expression" :
                                                    "Unclosed regular expression.", line, from + l);
                                            }
                                            q = true;
                                        }
                                    }
                                    break;
                                case ']':
                                case '?':
                                case '{':
                                case '}':
                                case '+':
                                case '*':
                                    warningAt("Unescaped '{a}'.", line, from + l, c);
                                    break;
                                default:
                                    if (c < ' ') {
                                        warningAt("Control character in a regular expression", line, from + l);
                                    }
                                }
                                if (b) {
                                    switch (s.charAt(l)) {
                                    case '?':
                                    case '+':
                                    case '*':
                                        l += 1;
                                        if (s.charAt(l) === '?') {
                                            l += 1;
                                        }
                                        break;
                                    case '{':
                                        l += 1;
                                        c = s.charAt(l);
                                        if (c < '0' || c > '9') {
                                            warningAt("Expected a number and instead saw '{a}'.", line, from + l, c);
                                        }
                                        l += 1;
                                        low = +c;
                                        for (;;) {
                                            c = s.charAt(l);
                                            if (c < '0' || c > '9') {
                                                break;
                                            }
                                            l += 1;
                                            low = +c + (low * 10);
                                        }
                                        high = low;
                                        if (c === ',') {
                                            l += 1;
                                            high = Infinity;
                                            c = s.charAt(l);
                                            if (c >= '0' && c <= '9') {
                                                l += 1;
                                                high = +c;
                                                for (;;) {
                                                    c = s.charAt(l);
                                                    if (c < '0' || c > '9') {
                                                        break;
                                                    }
                                                    l += 1;
                                                    high = +c + (high * 10);
                                                }
                                            }
                                        }
                                        if (s.charAt(l) !== '}') {
                                            warningAt("Expected '{a}' and instead saw '{b}'.", line, from + l, '}', c);
                                        } else {
                                            l += 1;
                                        }
                                        if (s.charAt(l) === '?') {
                                            l += 1;
                                        }
                                        if (low > high) {
                                            warningAt("'{a}' should not be greater than '{b}'.", line, from + l, low, high);
                                        }
                                    }
                                }
                            }
                            c = s.substr(0, l - 1);
                            character += l;
                            s = s.substr(l);
                            return it('(regex)', c);
                        }
                        return it('(punctuator)', t);

//      punctuator

                    default:
                        return it('(punctuator)', t);
                    }
                }
            }
74448
function boxIntersectIter(
  d, visit, initFull,
  xSize, xBoxes, xIndex,
  ySize, yBoxes, yIndex) {

  //Reserve memory for stack
  iterInit(d, xSize + ySize)

  var top  = 0
  var elemSize = 2 * d
  var retval

  iterPush(top++,
      0,
      0, xSize,
      0, ySize,
      initFull ? 16 : 0, 
      -Infinity, Infinity)
  if(!initFull) {
    iterPush(top++,
      0,
      0, ySize,
      0, xSize,
      1, 
      -Infinity, Infinity)
  }

  while(top > 0) {
    top  -= 1

    var iptr = top * IFRAME_SIZE
    var axis      = BOX_ISTACK[iptr]
    var redStart  = BOX_ISTACK[iptr+1]
    var redEnd    = BOX_ISTACK[iptr+2]
    var blueStart = BOX_ISTACK[iptr+3]
    var blueEnd   = BOX_ISTACK[iptr+4]
    var state     = BOX_ISTACK[iptr+5]

    var dptr = top * DFRAME_SIZE
    var lo        = BOX_DSTACK[dptr]
    var hi        = BOX_DSTACK[dptr+1]

    //Unpack state info
    var flip      = (state & 1)
    var full      = !!(state & 16)

    //Unpack indices
    var red       = xBoxes
    var redIndex  = xIndex
    var blue      = yBoxes
    var blueIndex = yIndex
    if(flip) {
      red         = yBoxes
      redIndex    = yIndex
      blue        = xBoxes
      blueIndex   = xIndex
    }

    if(state & 2) {
      redEnd = partitionStartLessThan(
        d, axis,
        redStart, redEnd, red, redIndex,
        hi)
      if(redStart >= redEnd) {
        continue
      }
    }
    if(state & 4) {
      redStart = partitionEndLessThanEqual(
        d, axis,
        redStart, redEnd, red, redIndex,
        lo)
      if(redStart >= redEnd) {
        continue
      }
    }
    
    var redCount  = redEnd  - redStart
    var blueCount = blueEnd - blueStart

    if(full) {
      if(d * redCount * (redCount + blueCount) < SCAN_COMPLETE_CUTOFF) {
        retval = sweep.scanComplete(
          d, axis, visit, 
          redStart, redEnd, red, redIndex,
          blueStart, blueEnd, blue, blueIndex)
        if(retval !== void 0) {
          return retval
        }
        continue
      }
    } else {
      if(d * Math.min(redCount, blueCount) < BRUTE_FORCE_CUTOFF) {
        //If input small, then use brute force
        retval = bruteForcePartial(
            d, axis, visit, flip,
            redStart,  redEnd,  red,  redIndex,
            blueStart, blueEnd, blue, blueIndex)
        if(retval !== void 0) {
          return retval
        }
        continue
      } else if(d * redCount * blueCount < SCAN_CUTOFF) {
        //If input medium sized, then use sweep and prune
        retval = sweep.scanBipartite(
          d, axis, visit, flip, 
          redStart, redEnd, red, redIndex,
          blueStart, blueEnd, blue, blueIndex)
        if(retval !== void 0) {
          return retval
        }
        continue
      }
    }
    
    //First, find all red intervals whose interior contains (lo,hi)
    var red0 = partitionInteriorContainsInterval(
      d, axis, 
      redStart, redEnd, red, redIndex,
      lo, hi)

    //Lower dimensional case
    if(redStart < red0) {

      if(d * (red0 - redStart) < BRUTE_FORCE_CUTOFF) {
        //Special case for small inputs: use brute force
        retval = bruteForceFull(
          d, axis+1, visit,
          redStart, red0, red, redIndex,
          blueStart, blueEnd, blue, blueIndex)
        if(retval !== void 0) {
          return retval
        }
      } else if(axis === d-2) {
        if(flip) {
          retval = sweep.sweepBipartite(
            d, visit,
            blueStart, blueEnd, blue, blueIndex,
            redStart, red0, red, redIndex)
        } else {
          retval = sweep.sweepBipartite(
            d, visit,
            redStart, red0, red, redIndex,
            blueStart, blueEnd, blue, blueIndex)
        }
        if(retval !== void 0) {
          return retval
        }
      } else {
        iterPush(top++,
          axis+1,
          redStart, red0,
          blueStart, blueEnd,
          flip,
          -Infinity, Infinity)
        iterPush(top++,
          axis+1,
          blueStart, blueEnd,
          redStart, red0,
          flip^1,
          -Infinity, Infinity)
      }
    }

    //Divide and conquer phase
    if(red0 < redEnd) {

      //Cut blue into 3 parts:
      //
      //  Points < mid point
      //  Points = mid point
      //  Points > mid point
      //
      var blue0 = findMedian(
        d, axis, 
        blueStart, blueEnd, blue, blueIndex)
      var mid = blue[elemSize * blue0 + axis]
      var blue1 = partitionStartEqual(
        d, axis,
        blue0, blueEnd, blue, blueIndex,
        mid)

      //Right case
      if(blue1 < blueEnd) {
        iterPush(top++,
          axis,
          red0, redEnd,
          blue1, blueEnd,
          (flip|4) + (full ? 16 : 0),
          mid, hi)
      }

      //Left case
      if(blueStart < blue0) {
        iterPush(top++,
          axis,
          red0, redEnd,
          blueStart, blue0,
          (flip|2) + (full ? 16 : 0),
          lo, mid)
      }

      //Center case (the hard part)
      if(blue0 + 1 === blue1) {
        //Optimization: Range with exactly 1 point, use a brute force scan
        if(full) {
          retval = onePointFull(
            d, axis, visit,
            red0, redEnd, red, redIndex,
            blue0, blue, blueIndex[blue0])
        } else {
          retval = onePointPartial(
            d, axis, visit, flip,
            red0, redEnd, red, redIndex,
            blue0, blue, blueIndex[blue0])
        }
        if(retval !== void 0) {
          return retval
        }
      } else if(blue0 < blue1) {
        var red1
        if(full) {
          //If full intersection, need to handle special case
          red1 = partitionContainsPoint(
            d, axis,
            red0, redEnd, red, redIndex,
            mid)
          if(red0 < red1) {
            var redX = partitionStartEqual(
              d, axis,
              red0, red1, red, redIndex,
              mid)
            if(axis === d-2) {
              //Degenerate sweep intersection:
              //  [red0, redX] with [blue0, blue1]
              if(red0 < redX) {
                retval = sweep.sweepComplete(
                  d, visit,
                  red0, redX, red, redIndex,
                  blue0, blue1, blue, blueIndex)
                if(retval !== void 0) {
                  return retval
                }
              }

              //Normal sweep intersection:
              //  [redX, red1] with [blue0, blue1]
              if(redX < red1) {
                retval = sweep.sweepBipartite(
                  d, visit,
                  redX, red1, red, redIndex,
                  blue0, blue1, blue, blueIndex)
                if(retval !== void 0) {
                  return retval
                }
              }
            } else {
              if(red0 < redX) {
                iterPush(top++,
                  axis+1,
                  red0, redX,
                  blue0, blue1,
                  16,
                  -Infinity, Infinity)
              }
              if(redX < red1) {
                iterPush(top++,
                  axis+1,
                  redX, red1,
                  blue0, blue1,
                  0,
                  -Infinity, Infinity)
                iterPush(top++,
                  axis+1,
                  blue0, blue1,
                  redX, red1,
                  1,
                  -Infinity, Infinity)
              }
            }
          }
        } else {
          if(flip) {
            red1 = partitionContainsPointProper(
              d, axis,
              red0, redEnd, red, redIndex,
              mid)
          } else {
            red1 = partitionContainsPoint(
              d, axis,
              red0, redEnd, red, redIndex,
              mid)
          }
          if(red0 < red1) {
            if(axis === d-2) {
              if(flip) {
                retval = sweep.sweepBipartite(
                  d, visit,
                  blue0, blue1, blue, blueIndex,
                  red0, red1, red, redIndex)
              } else {
                retval = sweep.sweepBipartite(
                  d, visit,
                  red0, red1, red, redIndex,
                  blue0, blue1, blue, blueIndex)
              }
            } else {
              iterPush(top++,
                axis+1,
                red0, red1,
                blue0, blue1,
                flip,
                -Infinity, Infinity)
              iterPush(top++,
                axis+1,
                blue0, blue1,
                red0, red1,
                flip^1,
                -Infinity, Infinity)
            }
          }
        }
      }
    }
  }
}
646431
def bbox(self):
        
        bbox = self._data.get(b'keyOriginShapeBBox')
        if bbox:
            return (
                bbox.get(b'Left').value,
                bbox.get(b'Top ').value,
                bbox.get(b'Rght').value,
                bbox.get(b'Btom').value,
            )
        return (0, 0, 0, 0)