

def prepare_request(self):
    headers = {
        'User-Agent': self.user_agent,
    }
    if (isinstance(self.auth, tuple) and (len(self.auth) == 2)):
        auth_str = ('Basic ' + base64.encodestring(('%s:%s' % self.auth)).strip())
    else:
        auth_str = ('Bearer %s' % self.auth)
    headers['Authorization'] = auth_str
    if auth_str.files:
        (content_type, data) = self.encode_multipart_data()
        headers.update({
            'Content-Type': content_type,
            'Content-Length': str(len(data)),
        })
    else:
        headers['Content-type'] = 'application/x-www-form-urlencoded; charset=utf-8'
        data = urlencode(self.data).encode('utf-8')
    return (headers, data)

dataset/ETHPy150Open smsapi/smsapi-python-client/smsapi/proxy.py ApiHttpProxy.prepare_request/VarMisuse@95/125 `self`->`auth_str`