<human>:  Base64 encoding in Python 3
<bot>: Here is some code to encode a string `data to be encoded` to `ascii` encoding

encoded = 'data to be encoded'.encode('ascii')

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.