<s> from bitstring import BitArray <EOL> from . field import BreadField <EOL> def encode_bool ( value ) : <EOL> return BitArray ( bool = value ) <EOL> def decode_bool ( encoded ) : <EOL> return encoded . bool <EOL> def boolean ( parent , ** field_options ) : <EOL> return BreadField ( <EOL> <NUM_LIT:1> , encode_bool , decode_bool , <EOL> str_format = field_options . get ( '<STR_LIT>' , None ) ) </s>
