def to_flags(value):
 if ((value < 0) or (value > 4095)):
  raise ValueError('rcode must be >= 0 and <= 4095')
 v = (value & 15)
 ev = (long((value & 4080)) << 20)
 return (v, ev)

def to_flags ( value ) : if ( ( value < 0 ) or ( value > 4095 ) ) : raise ValueError ( 'rcode must be >= 0 and <= 4095' ) v = ( value & 15 ) ev = ( long ( ( value & 4080 ) ) << 20 ) return ( v , ev )
return a tuple which encodes the rcode .