There is a docstring @param email: string emails divided by commas 'email_1, ..., email_n', but in this line base64.b64encode expects bytes type. If I pass bytes, then there will be an exception later in __send_request in this line. I think it will be better to call .encode('utf-8') on email parameter before calling base64.b64encode.