def isSane(totalLen, payloadLen, flags):
 def isFine(length):
  '\n        Check if the given length is fine.\n        '
  return (True if (0 <= length <= const.MPU) else False)
 validFlags = [const.FLAG_PAYLOAD, const.FLAG_NEW_TICKET, const.FLAG_PRNG_SEED]
 return (isFine(totalLen) and isFine(payloadLen) and (totalLen >= payloadLen) and (flags in validFlags))

def isSane ( totalLen , payloadLen , flags ) : def isFine ( length ) : return ( True if ( 0 <= length <= const . MPU ) else False ) validFlags = [ const . FLAG_PAYLOAD , const . FLAG_NEW_TICKET , const . FLAG_PRNG_SEED ] return ( isFine ( totalLen ) and isFine ( payloadLen ) and ( totalLen >= payloadLen ) and ( flags in validFlags ) )
verifies whether the given header fields are sane .