human
Python 3: How do I get a string literal representation of a byte string?
assistant
Here is some code to get a utf-8 string literal representation of byte string `x`

"""x = {}""".format(x.decode('utf8')).encode('utf8')

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