Icing.

    Args:
        msg (String): 28 bytes hexadecimal message string

    Returns:
        int: Icing level. 0=NIL, 1=Light, 2=Moderate, 3=Severe
487271
def ic45(msg):
    
    d = hex2bin(data(msg))
    if d[9] == '0':
        return None

    ic = bin2int(d[10:12])
    return ic
583137
def msg_(self, label, *msg):
        
        txt = self._unpack_msg(*msg)
        return "[" + label + "] " + txt
712482
def parse(self, msg):
        
        #init
        dictValues = HL7Dict(self.tersersep)
        msg_ = msg.strip('\r\n ')

        # extracts separator defined in the message itself
        self.extractSeparators(dictValues, msg_)
        msg_ = msg_.replace('\r', '\n')
        lines = msg_.split('\n')
        lineNumber = 1

        # build the map of segments
        segmentNameCount, lineMap = self.buildSegmentMap(lines)
        dictValues.setSegmentsMap(segmentNameCount, lineMap)

        # Parse each line of the message : 1 line = 1 segment
        for line in lines:
            dictValues.currentLineNumber = lineNumber
            self.extractValues(dictValues, line)
            lineNumber += 1

        return dictValues
1278490
def msg(self, level, s, *args):
        
        if s and level <= self.debug:
            print "%s%s %s" % ("  " * self.indent, s, ' '.join(map(repr, args)))
291335
function parse(msg) {
	var pMsg;
  if (typeof msg === 'object') {
    // data is a MessageEvent not a raw string
    pMsg = msg.data;
  } else {
		pMsg = msg;
	}

  var model;
  if (startsWith(pMsg, REGISTER)) {
    var payload = pMsg.substring(REGISTER.length + SEP.length);
    var i = 0;
    var ch = payload.charAt(i);
    var buffer = '';
    while (i < payload.length && ch !== '/') {
      i++;
      buffer += ch;
      ch = payload.charAt(i);
    }

    if (ch !== '/') {
      buffer += ch;
    } else {
      i++;
    }
    model = null;
    if (i < payload.length) {
      model = payload.substring(i, payload.length);
    }
    return new RegisterMessage(buffer, model);
  }

  if (startsWith(pMsg, PUSH + SEP)) {
    model = pMsg.substring(PUSH.length + SEP.length);
    return new PushMessage(model);
  }

  if (startsWith(pMsg, KEVS + SEP)) {
    model = pMsg.substring(KEVS.length + SEP.length);
    return new PushKevSMessage(model);
  }

  if (startsWith(pMsg, PULL)) {
    return new PullMessage();
  }

  /* retro compat */
  if (startsWith(pMsg, 'get')) {
    return new PullMessage();
  }

  return null;
}
219246
String formatMessage(int msgLogLevel, String module, String msg) {
        return getLevelTag(msgLogLevel) + module + ": " + msg;
    }
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)
307841
def get_message(self, level, alert, value, **kwargs):
        
        target, ntype = kwargs.get('target'), kwargs.get('ntype')

        msg_type = 'telegram' if ntype == 'graphite' else 'short'
        tmpl = TEMPLATES[ntype][msg_type]
        generated = tmpl.generate(
            level=level, reactor=self.reactor, alert=alert,
            value=value, target=target,)
        return generated.decode().strip()
494602
def wv45(msg):
    
    d = hex2bin(data(msg))
    if d[12] == '0':
        return None

    ws = bin2int(d[13:15])
    return ws
952385
def decrypt(self, msg, alg='aes_128_cbc', padding='PKCS#7', b64dec=True):
        
        self.__class__._deprecation_notice()
        data = _base64.b64decode(msg) if b64dec else msg

        cipher, iv = self.build_cipher(alg=alg)
        decryptor = cipher.decryptor()
        res = decryptor.update(data)[self.AES_BLOCK_SIZE:]
        res += decryptor.finalize()
        if padding in ['PKCS#5', 'PKCS#7']:
            idx = bytearray(res)[-1]
            res = res[:-idx]
        return res
1349350
def _checksum(self, msg):
        
        def carry_around_add(a, b):
            c = a + b
            return (c & 0xffff) + (c >> 16)

        s = 0
        for i in range(0, len(msg), 2):
            w = (msg[i] << 8) + msg[i + 1]
            s = carry_around_add(s, w)
        s = ~s & 0xffff

        return s
582256
def _read_message(self):
    
    size = int(self.buf.read_line().decode("utf-8"))
    return self.buf.read(size).decode("utf-8")
423513
def formatted_message( severity, msg )
      msg = String === msg ? msg : msg.inspect

      if args = _matched( msg )
        args.first.call msg, args.last
      elsif proc = configuration[:severities][severity]
        proc.call msg
      else
        msg
      end
    end
149852
def cs20(msg):
    
    chars = '#ABCDEFGHIJKLMNOPQRSTUVWXYZ#####_###############0123456789######'

    d = hex2bin(data(msg))

    cs = ''
    cs += chars[bin2int(d[8:14])]
    cs += chars[bin2int(d[14:20])]
    cs += chars[bin2int(d[20:26])]
    cs += chars[bin2int(d[26:32])]
    cs += chars[bin2int(d[32:38])]
    cs += chars[bin2int(d[38:44])]
    cs += chars[bin2int(d[44:50])]
    cs += chars[bin2int(d[50:56])]

    return cs
1216036
def allzeros(msg):
    
    d = hex2bin(data(msg))

    if bin2int(d) > 0:
        return False
    else:
        return True
15400
def version(msg):
    
    tc = typecode(msg)

    if tc != 31:
        raise RuntimeError("%s: Not a status operation message, expecting TC = 31" % msg)

    msgbin = common.hex2bin(msg)
    version = common.bin2int(msgbin[72:75])

    return version
140873
def parse_challenge_message(self, msg2):
        
        msg2 = base64.b64decode(msg2)
        self.challenge_message = ChallengeMessage(msg2)