<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def retrieve_authorization_code(self, redirect_func=None):
 """ retrieve authorization code to get access token """

        
        request_param = {
            "client_id": self.client_id,
            "redirect_uri": self.redirect_uri,
            }

        if self.scope:
            request_param['scope'] = self.scope

        if self._extra_auth_params:
            request_param.update(self._extra_auth_params)

        r = requests.get(self.auth_uri, params=request_param,
                         allow_redirects=False)
        url = r.headers.get('location') 
        if self.local:
            webbrowser.open_new_tab(url)
            authorization_code = raw_input("Code: ")
            if self.validate_code(authorization_code):
                self.authorization_code = authorization_code
        else:
            return redirect_func(url)