Human: Base64 encoding in Python 3 Assistant: 
Here is some code to encode string 'data to be encoded'

encoded = base64.b64encode('data to be encoded')

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