def from_flags(flags, ednsflags):
 value = ((flags & 15) | ((ednsflags >> 20) & 4080))
 if ((value < 0) or (value > 4095)):
  raise ValueError('rcode must be >= 0 and <= 4095')
 return value

def from_flags ( flags , ednsflags ) : value = ( ( flags & 15 ) | ( ( ednsflags >> 20 ) & 4080 ) ) if ( ( value < 0 ) or ( value > 4095 ) ) : raise ValueError ( 'rcode must be >= 0 and <= 4095' ) return value
return the rcode value encoded by flags and ednsflags .