def ParsePingMsg(msg):
 parsed = re.match(kPingMsgRe, msg)
 if (not parsed):
  return None
 try:
  return parsed.group(1)
 except IndexError as e:
  logging.warning(('RE matched "%s", but extracted wrong numbers of items: %r' % (msg, e)))
  return None

def ParsePingMsg ( msg ) : parsed = re . match ( kPingMsgRe , msg ) if ( not parsed ) : return None try : return parsed . group ( 1 ) except IndexError as e : logging . warning ( ( 'RE matched "%s", but extracted wrong numbers of items: %r' % ( msg , e ) ) ) return None
attempt to parse the message for a ping .