def get_user_headers(user):
 credentials = ('%s:secret' % user)
 authorization = 'Basic {0}'.format(encode64(credentials))
 return {'Authorization': authorization}

def get_user_headers ( user ) : credentials = ( '%s:secret' % user ) authorization = 'Basic {0}' . format ( encode64 ( credentials ) ) return { 'Authorization' : authorization }
helper to obtain a basic auth authorization headers from the specified user :rtype: dict .