code: def to_flags(value):
      
  
      if value < 0 or value > 4095:
          raise ValueError('rcode must be >= 0 and <= 4095')
      v = value & 0xf
      ev = long(value & 0xff0) << 20
      return (v, ev)
docs: Return a (flags, ednsflags) tuple which encodes the rcode.
  
      @param value: the rcode
      @type value: int
      @raises ValueError: rcode is < 0 or > 4095
      @rtype: (int, int) tuple