A UN M.49 is a 3 digit numeric code.
487051
private static boolean isUnM49AreaCode(String code) {
        if (code.length() != 3) {
            return false;
        }

        for (int i = 0; i < 3; ++i) {
            final char character = code.charAt(i);
            if (!(character >= '0' && character <= '9')) {
                return false;
            }
        }

        return true;
    }
607884
def human_readable_digit(number):
    

    if 0 >= number:
        return "{0:.1f} ".format(number)

    word = ["", "thousand", "million", "billion", "trillion"]
    millidx = max(0, min(len(word)-1, int(np.floor(np.log10(abs(number))/3.0))))
    return "{0:.1f} {1}".format(number/10**(3*millidx), word[millidx])
537156
def _prefix_number_with_country_calling_code(country_code, num_format, formatted_number):
    """"""
    if num_format == PhoneNumberFormat.E164:
        return _PLUS_SIGN + unicod(country_code) + formatted_number
    elif num_format == PhoneNumberFormat.INTERNATIONAL:
        return _PLUS_SIGN + unicod(country_code) + U_SPACE + formatted_number
    elif num_format == PhoneNumberFormat.RFC3966:
        return _RFC3966_PREFIX + _PLUS_SIGN + unicod(country_code) + U_DASH + formatted_number
    else:
        return formatted_number
171717
function (m, n) {
      m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]
      n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]
      var o = [0, 0, 0, 0]
      o[3] += m[3] * n[3]
      o[2] += o[3] >>> 16
      o[3] &= 0xffff
      o[2] += m[2] * n[3]
      o[1] += o[2] >>> 16
      o[2] &= 0xffff
      o[2] += m[3] * n[2]
      o[1] += o[2] >>> 16
      o[2] &= 0xffff
      o[1] += m[1] * n[3]
      o[0] += o[1] >>> 16
      o[1] &= 0xffff
      o[1] += m[2] * n[2]
      o[0] += o[1] >>> 16
      o[1] &= 0xffff
      o[1] += m[3] * n[1]
      o[0] += o[1] >>> 16
      o[1] &= 0xffff
      o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0])
      o[0] &= 0xffff
      return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]
    }
198577
private final void appendNumericSegmentCEs(CharSequence digits) {
        int length = digits.length();
        assert(1 <= length && length <= 254);
        assert(length == 1 || digits.charAt(0) != 0);
        long numericPrimary = data.numericPrimary;
        // Note: We use primary byte values 2..255: digits are not compressible.
        if(length <= 7) {
            // Very dense encoding for small numbers.
            int value = digits.charAt(0);
            for(int i = 1; i < length; ++i) {
                value = value * 10 + digits.charAt(i);
            }
            // Primary weight second byte values:
            //     74 byte values   2.. 75 for small numbers in two-byte primary weights.
            //     40 byte values  76..115 for medium numbers in three-byte primary weights.
            //     16 byte values 116..131 for large numbers in four-byte primary weights.
            //    124 byte values 132..255 for very large numbers with 4..127 digit pairs.
            int firstByte = 2;
            int numBytes = 74;
            if(value < numBytes) {
                // Two-byte primary for 0..73, good for day & month numbers etc.
                long primary = numericPrimary | ((firstByte + value) << 16);
                ceBuffer.append(Collation.makeCE(primary));
                return;
            }
            value -= numBytes;
            firstByte += numBytes;
            numBytes = 40;
            if(value < numBytes * 254) {
                // Three-byte primary for 74..10233=74+40*254-1, good for year numbers and more.
                long primary = numericPrimary |
                    ((firstByte + value / 254) << 16) | ((2 + value % 254) << 8);
                ceBuffer.append(Collation.makeCE(primary));
                return;
            }
            value -= numBytes * 254;
            firstByte += numBytes;
            numBytes = 16;
            if(value < numBytes * 254 * 254) {
                // Four-byte primary for 10234..1042489=10234+16*254*254-1.
                long primary = numericPrimary | (2 + value % 254);
                value /= 254;
                primary |= (2 + value % 254) << 8;
                value /= 254;
                primary |= (firstByte + value % 254) << 16;
                ceBuffer.append(Collation.makeCE(primary));
                return;
            }
            // original value > 1042489
        }
        assert(length >= 7);

        // The second primary byte value 132..255 indicates the number of digit pairs (4..127),
        // then we generate primary bytes with those pairs.
        // Omit trailing 00 pairs.
        // Decrement the value for the last pair.

        // Set the exponent. 4 pairs.132, 5 pairs.133, ..., 127 pairs.255.
        int numPairs = (length + 1) / 2;
        long primary = numericPrimary | ((132 - 4 + numPairs) << 16);
        // Find the length without trailing 00 pairs.
        while(digits.charAt(length - 1) == 0 && digits.charAt(length - 2) == 0) {
            length -= 2;
        }
        // Read the first pair.
        int pair;
        int pos;
        if((length & 1) != 0) {
            // Only "half a pair" if we have an odd number of digits.
            pair = digits.charAt(0);
            pos = 1;
        } else {
            pair = digits.charAt(0) * 10 + digits.charAt(1);
            pos = 2;
        }
        pair = 11 + 2 * pair;
        // Add the pairs of digits between pos and length.
        int shift = 8;
        while(pos < length) {
            if(shift == 0) {
                // Every three pairs/bytes we need to store a 4-byte-primary CE
                // and start with a new CE with the '0' primary lead byte.
                primary |= pair;
                ceBuffer.append(Collation.makeCE(primary));
                primary = numericPrimary;
                shift = 16;
            } else {
                primary |= pair << shift;
                shift -= 8;
            }
            pair = 11 + 2 * (digits.charAt(pos) * 10 + digits.charAt(pos + 1));
            pos += 2;
        }
        primary |= (pair - 1) << shift;
        ceBuffer.append(Collation.makeCE(primary));
    }
931476
public final void mNUM_INT() throws RecognitionException {
		try {
			int _type = NUM_INT;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			CommonToken f1=null;
			CommonToken f2=null;
			CommonToken f3=null;
			CommonToken f4=null;

			boolean isDecimal=false; Token t=null;
			// hql.g:804:2: ( '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? | ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) |{...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? |f4= FLOAT_SUFFIX ) )? )
			int alt20=2;
			int LA20_0 = input.LA(1);
			if ( (LA20_0=='.') ) {
				alt20=1;
			}
			else if ( ((LA20_0 >= '0' && LA20_0 <= '9')) ) {
				alt20=2;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 20, 0, input);
				throw nvae;
			}

			switch (alt20) {
				case 1 :
					// hql.g:804:6: '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )?
					{
					match('.'); if (state.failed) return;
					if ( state.backtracking==0 ) {_type = DOT;}
					// hql.g:805:4: ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )?
					int alt8=2;
					int LA8_0 = input.LA(1);
					if ( ((LA8_0 >= '0' && LA8_0 <= '9')) ) {
						alt8=1;
					}
					switch (alt8) {
						case 1 :
							// hql.g:805:6: ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )?
							{
							// hql.g:805:6: ( '0' .. '9' )+
							int cnt5=0;
							loop5:
							while (true) {
								int alt5=2;
								int LA5_0 = input.LA(1);
								if ( ((LA5_0 >= '0' && LA5_0 <= '9')) ) {
									alt5=1;
								}

								switch (alt5) {
								case 1 :
									// hql.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt5 >= 1 ) break loop5;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(5, input);
									throw eee;
								}
								cnt5++;
							}

							// hql.g:805:18: ( EXPONENT )?
							int alt6=2;
							int LA6_0 = input.LA(1);
							if ( (LA6_0=='e') ) {
								alt6=1;
							}
							switch (alt6) {
								case 1 :
									// hql.g:805:19: EXPONENT
									{
									mEXPONENT(); if (state.failed) return;

									}
									break;

							}

							// hql.g:805:30: (f1= FLOAT_SUFFIX )?
							int alt7=2;
							int LA7_0 = input.LA(1);
							if ( (LA7_0=='d'||LA7_0=='f'||LA7_0=='m') ) {
								alt7=1;
							}
							switch (alt7) {
								case 1 :
									// hql.g:805:31: f1= FLOAT_SUFFIX
									{
									int f1Start986 = getCharIndex();
									int f1StartLine986 = getLine();
									int f1StartCharPos986 = getCharPositionInLine();
									mFLOAT_SUFFIX(); if (state.failed) return;
									f1 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f1Start986, getCharIndex()-1);
									f1.setLine(f1StartLine986);
									f1.setCharPositionInLine(f1StartCharPos986);

									if ( state.backtracking==0 ) {t=f1;}
									}
									break;

							}

							if ( state.backtracking==0 ) {
												if (t != null && t.getText().toUpperCase().indexOf('F')>=0)
												{
													_type = NUM_FLOAT;
												}
												else if (t != null && t.getText().toUpperCase().indexOf('M')>=0)
												{
													_type = NUM_DECIMAL;
												}
												else
												{
													_type = NUM_DOUBLE; // assume double
												}
											}
							}
							break;

					}

					}
					break;
				case 2 :
					// hql.g:821:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) |{...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? |f4= FLOAT_SUFFIX ) )?
					{
					// hql.g:821:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* )
					int alt13=2;
					int LA13_0 = input.LA(1);
					if ( (LA13_0=='0') ) {
						alt13=1;
					}
					else if ( ((LA13_0 >= '1' && LA13_0 <= '9')) ) {
						alt13=2;
					}

					else {
						if (state.backtracking>0) {state.failed=true; return;}
						NoViableAltException nvae =
							new NoViableAltException("", 13, 0, input);
						throw nvae;
					}

					switch (alt13) {
						case 1 :
							// hql.g:821:6: '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )?
							{
							match('0'); if (state.failed) return;
							if ( state.backtracking==0 ) {isDecimal = true;}
							// hql.g:822:4: ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )?
							int alt11=3;
							int LA11_0 = input.LA(1);
							if ( (LA11_0=='x') ) {
								alt11=1;
							}
							else if ( ((LA11_0 >= '0' && LA11_0 <= '7')) ) {
								alt11=2;
							}
							switch (alt11) {
								case 1 :
									// hql.g:822:6: ( 'x' ) ( HEX_DIGIT )+
									{
									// hql.g:822:6: ( 'x' )
									// hql.g:822:7: 'x'
									{
									match('x'); if (state.failed) return;
									}

									// hql.g:823:5: ( HEX_DIGIT )+
									int cnt9=0;
									loop9:
									while (true) {
										int alt9=2;
										switch ( input.LA(1) ) {
										case 'e':
											{
											int LA9_2 = input.LA(2);
											if ( ((LA9_2 >= '0' && LA9_2 <= '9')) ) {
												int LA9_5 = input.LA(3);
												if ( (!(((isDecimal)))) ) {
													alt9=1;
												}

											}
											else {
												alt9=1;
											}

											}
											break;
										case 'd':
										case 'f':
											{
											int LA9_3 = input.LA(2);
											if ( (!(((isDecimal)))) ) {
												alt9=1;
											}

											}
											break;
										case '0':
										case '1':
										case '2':
										case '3':
										case '4':
										case '5':
										case '6':
										case '7':
										case '8':
										case '9':
										case 'a':
										case 'b':
										case 'c':
											{
											alt9=1;
											}
											break;
										}
										switch (alt9) {
										case 1 :
											// hql.g:
											{
											if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'a' && input.LA(1) <= 'f') ) {
												input.consume();
												state.failed=false;
											}
											else {
												if (state.backtracking>0) {state.failed=true; return;}
												MismatchedSetException mse = new MismatchedSetException(null,input);
												recover(mse);
												throw mse;
											}
											}
											break;

										default :
											if ( cnt9 >= 1 ) break loop9;
											if (state.backtracking>0) {state.failed=true; return;}
											EarlyExitException eee = new EarlyExitException(9, input);
											throw eee;
										}
										cnt9++;
									}

									}
									break;
								case 2 :
									// hql.g:832:6: ( '0' .. '7' )+
									{
									// hql.g:832:6: ( '0' .. '7' )+
									int cnt10=0;
									loop10:
									while (true) {
										int alt10=2;
										int LA10_0 = input.LA(1);
										if ( ((LA10_0 >= '0' && LA10_0 <= '7')) ) {
											alt10=1;
										}

										switch (alt10) {
										case 1 :
											// hql.g:
											{
											if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) {
												input.consume();
												state.failed=false;
											}
											else {
												if (state.backtracking>0) {state.failed=true; return;}
												MismatchedSetException mse = new MismatchedSetException(null,input);
												recover(mse);
												throw mse;
											}
											}
											break;

										default :
											if ( cnt10 >= 1 ) break loop10;
											if (state.backtracking>0) {state.failed=true; return;}
											EarlyExitException eee = new EarlyExitException(10, input);
											throw eee;
										}
										cnt10++;
									}

									}
									break;

							}

							}
							break;
						case 2 :
							// hql.g:834:5: ( '1' .. '9' ) ( '0' .. '9' )*
							{
							if ( (input.LA(1) >= '1' && input.LA(1) <= '9') ) {
								input.consume();
								state.failed=false;
							}
							else {
								if (state.backtracking>0) {state.failed=true; return;}
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							// hql.g:834:16: ( '0' .. '9' )*
							loop12:
							while (true) {
								int alt12=2;
								int LA12_0 = input.LA(1);
								if ( ((LA12_0 >= '0' && LA12_0 <= '9')) ) {
									alt12=1;
								}

								switch (alt12) {
								case 1 :
									// hql.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									break loop12;
								}
							}

							if ( state.backtracking==0 ) {isDecimal=true;}
							}
							break;

					}

					// hql.g:836:3: ( ( 'l' ) |{...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? |f4= FLOAT_SUFFIX ) )?
					int alt19=3;
					int LA19_0 = input.LA(1);
					if ( (LA19_0=='l') ) {
						alt19=1;
					}
					else if ( (LA19_0=='.'||(LA19_0 >= 'd' && LA19_0 <= 'f')||LA19_0=='m') ) {
						alt19=2;
					}
					switch (alt19) {
						case 1 :
							// hql.g:836:5: ( 'l' )
							{
							// hql.g:836:5: ( 'l' )
							// hql.g:836:6: 'l'
							{
							match('l'); if (state.failed) return;
							}

							if ( state.backtracking==0 ) { _type = NUM_LONG; }
							}
							break;
						case 2 :
							// hql.g:839:5: {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? |f4= FLOAT_SUFFIX )
							{
							if ( !((isDecimal)) ) {
								if (state.backtracking>0) {state.failed=true; return;}
								throw new FailedPredicateException(input, "NUM_INT", "isDecimal");
							}
							// hql.g:840:4: ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? |f4= FLOAT_SUFFIX )
							int alt18=3;
							switch ( input.LA(1) ) {
							case '.':
								{
								alt18=1;
								}
								break;
							case 'e':
								{
								alt18=2;
								}
								break;
							case 'd':
							case 'f':
							case 'm':
								{
								alt18=3;
								}
								break;
							default:
								if (state.backtracking>0) {state.failed=true; return;}
								NoViableAltException nvae =
									new NoViableAltException("", 18, 0, input);
								throw nvae;
							}
							switch (alt18) {
								case 1 :
									// hql.g:840:8: '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )?
									{
									match('.'); if (state.failed) return;
									// hql.g:840:12: ( '0' .. '9' )*
									loop14:
									while (true) {
										int alt14=2;
										int LA14_0 = input.LA(1);
										if ( ((LA14_0 >= '0' && LA14_0 <= '9')) ) {
											alt14=1;
										}

										switch (alt14) {
										case 1 :
											// hql.g:
											{
											if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
												input.consume();
												state.failed=false;
											}
											else {
												if (state.backtracking>0) {state.failed=true; return;}
												MismatchedSetException mse = new MismatchedSetException(null,input);
												recover(mse);
												throw mse;
											}
											}
											break;

										default :
											break loop14;
										}
									}

									// hql.g:840:24: ( EXPONENT )?
									int alt15=2;
									int LA15_0 = input.LA(1);
									if ( (LA15_0=='e') ) {
										alt15=1;
									}
									switch (alt15) {
										case 1 :
											// hql.g:840:25: EXPONENT
											{
											mEXPONENT(); if (state.failed) return;

											}
											break;

									}

									// hql.g:840:36: (f2= FLOAT_SUFFIX )?
									int alt16=2;
									int LA16_0 = input.LA(1);
									if ( (LA16_0=='d'||LA16_0=='f'||LA16_0=='m') ) {
										alt16=1;
									}
									switch (alt16) {
										case 1 :
											// hql.g:840:37: f2= FLOAT_SUFFIX
											{
											int f2Start1188 = getCharIndex();
											int f2StartLine1188 = getLine();
											int f2StartCharPos1188 = getCharPositionInLine();
											mFLOAT_SUFFIX(); if (state.failed) return;
											f2 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f2Start1188, getCharIndex()-1);
											f2.setLine(f2StartLine1188);
											f2.setCharPositionInLine(f2StartCharPos1188);

											if ( state.backtracking==0 ) {t=f2;}
											}
											break;

									}

									}
									break;
								case 2 :
									// hql.g:841:8: EXPONENT (f3= FLOAT_SUFFIX )?
									{
									mEXPONENT(); if (state.failed) return;

									// hql.g:841:17: (f3= FLOAT_SUFFIX )?
									int alt17=2;
									int LA17_0 = input.LA(1);
									if ( (LA17_0=='d'||LA17_0=='f'||LA17_0=='m') ) {
										alt17=1;
									}
									switch (alt17) {
										case 1 :
											// hql.g:841:18: f3= FLOAT_SUFFIX
											{
											int f3Start1206 = getCharIndex();
											int f3StartLine1206 = getLine();
											int f3StartCharPos1206 = getCharPositionInLine();
											mFLOAT_SUFFIX(); if (state.failed) return;
											f3 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f3Start1206, getCharIndex()-1);
											f3.setLine(f3StartLine1206);
											f3.setCharPositionInLine(f3StartCharPos1206);

											if ( state.backtracking==0 ) {t=f3;}
											}
											break;

									}

									}
									break;
								case 3 :
									// hql.g:842:8: f4= FLOAT_SUFFIX
									{
									int f4Start1221 = getCharIndex();
									int f4StartLine1221 = getLine();
									int f4StartCharPos1221 = getCharPositionInLine();
									mFLOAT_SUFFIX(); if (state.failed) return;
									f4 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f4Start1221, getCharIndex()-1);
									f4.setLine(f4StartLine1221);
									f4.setCharPositionInLine(f4StartCharPos1221);

									if ( state.backtracking==0 ) {t=f4;}
									}
									break;

							}

							if ( state.backtracking==0 ) {
											if (t != null && t.getText().toUpperCase().indexOf('F') >= 0)
											{
												_type = NUM_FLOAT;
											}
											else if (t != null && t.getText().toUpperCase().indexOf('M')>=0)
											{
												_type = NUM_DECIMAL;
											}
											else
											{
												_type = NUM_DOUBLE; // assume double
											}
										}
							}
							break;

					}

					}
					break;

			}
			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1063011
def is40(msg):
    

    if allzeros(msg):
        return False

    d = hex2bin(data(msg))

    # status bit 1, 14, and 27

    if wrongstatus(d, 1, 2, 13):
        return False

    if wrongstatus(d, 14, 15, 26):
        return False

    if wrongstatus(d, 27, 28, 39):
        return False

    if wrongstatus(d, 48, 49, 51):
        return False

    if wrongstatus(d, 54, 55, 56):
        return False

    # bits 40-47 and 52-53 shall all be zero

    if bin2int(d[39:47]) != 0:
        return False

    if bin2int(d[51:53]) != 0:
        return False

    return True
861870
function num2hex(triplet) {
        var hex_alphabets = "0123456789ABCDEF";
        var hex = "#";
        var int1, int2;
        for (var i = 0; i < 3; i++) {
            int1 = triplet[i] / 16;
            int2 = triplet[i] % 16;

            hex += hex_alphabets.charAt(int1) + hex_alphabets.charAt(int2);
        }
        return hex;
    }
533681
function(n) {
				
				// Es un número válido, no empieza por 0X (ej: 02) y solo contiene números y puntuación
				
				return !isNaN(parseFloat(n)) && isFinite(n) && /^(?!0\d)/.test(n) && /^[\d\.]+$/.test(n);

			}
285221
def baseN(num, b, numerals="0123456789abcdefghijklmnopqrstuvwxyz"):
    
    return ((num == 0) and numerals[0]) or \
        (baseN(num // b, b, numerals).lstrip(numerals[0]) + numerals[num % b])
365080
function d2h(d, digits) {
  d = d.toString(16); 
  while (d.length < digits) {
		d = '0' + d;
	}
	  
  return d;
}
703745
def is45(msg):
    
    if allzeros(msg):
        return False

    d = hex2bin(data(msg))

    # status bit 1, 4, 7, 10, 13, 16, 27, 39
    if wrongstatus(d, 1, 2, 3):
        return False

    if wrongstatus(d, 4, 5, 6):
        return False

    if wrongstatus(d, 7, 8, 9):
        return False

    if wrongstatus(d, 10, 11, 12):
        return False

    if wrongstatus(d, 13, 14, 15):
        return False

    if wrongstatus(d, 16, 17, 26):
        return False

    if wrongstatus(d, 27, 28, 38):
        return False

    if wrongstatus(d, 39, 40, 51):
        return False

    # reserved
    if bin2int(d[51:56]) != 0:
        return False

    temp = temp45(msg)
    if temp:
        if temp > 60 or temp < -80:
            return False

    return True
476363
function amf3encInteger(num) {
    var buf = new Buffer(1);
    buf.writeUInt8(0x4, 0);
    return Buffer.concat([buf, amf3encUI29(num & 0x3FFFFFFF)]); // This AND will auto convert the sign bit!
}
1005275
function checksum$3(number) {
	var result = 0;

	var i;
	for (i = 1; i < 11; i += 2) {
		result += parseInt(number[i]);
	}
	for (i = 0; i < 11; i += 2) {
		result += parseInt(number[i]) * 3;
	}

	return (10 - result % 10) % 10;
}
941313
private static int decodeBase31(@Nonnull final String code) {
        int value = 0;
        for (final char c : code.toCharArray()) {
            if (c == '.') {
                return value;
            }
            if (DECODE_CHARS[c] < 0) {
                return -1;
            }
            value = (value * 31) + DECODE_CHARS[c];
        }
        return value;
    }
818011
def murmur3_x86_32(data: Union[bytes, bytearray], seed: int = 0) -> int:
      # noqa
    c1 = 0xcc9e2d51
    c2 = 0x1b873593

    length = len(data)
    h1 = seed
    rounded_end = (length & 0xfffffffc)  # round down to 4 byte block
    for i in range(0, rounded_end, 4):
        # little endian load order
        # RNC: removed ord() calls
        k1 = (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) | \
             ((data[i + 2] & 0xff) << 16) | (data[i + 3] << 24)
        k1 *= c1
        k1 = (k1 << 15) | ((k1 & 0xffffffff) >> 17)  # ROTL32(k1, 15)
        k1 *= c2

        h1 ^= k1
        h1 = (h1 << 13) | ((h1 & 0xffffffff) >> 19)  # ROTL32(h1, 13)
        h1 = h1 * 5 + 0xe6546b64

    # tail
    k1 = 0

    val = length & 0x03
    if val == 3:
        k1 = (data[rounded_end + 2] & 0xff) << 16
    # fallthrough
    if val in (2, 3):
        k1 |= (data[rounded_end + 1] & 0xff) << 8
    # fallthrough
    if val in (1, 2, 3):
        k1 |= data[rounded_end] & 0xff
        k1 *= c1
        k1 = (k1 << 15) | ((k1 & 0xffffffff) >> 17)  # ROTL32(k1, 15)
        k1 *= c2
        h1 ^= k1

    # finalization
    h1 ^= length

    # fmix(h1)
    h1 ^= ((h1 & 0xffffffff) >> 16)
    h1 *= 0x85ebca6b
    h1 ^= ((h1 & 0xffffffff) >> 13)
    h1 *= 0xc2b2ae35
    h1 ^= ((h1 & 0xffffffff) >> 16)

    return h1 & 0xffffffff
802307
def trk50(msg):
    
    d = hex2bin(data(msg))

    if d[11] == '0':
        return None

    sign = int(d[12])   # 1 -> west
    value = bin2int(d[13:23])

    if sign:
        value = value - 1024

    trk = value * 90.0 / 512.0

    # convert from [-180, 180] to [0, 360]
    if trk < 0:
        trk = 360 + trk

    return round(trk, 3)