code: def generate_login_url(self, scopes=None, redirect_uri=None):
          
          url = self.base_url + "/oauth/authorize"
          split = list(urlparse(url))
          params = {
              "client_id": self.client_id,
              "response_type": "code", # needed for all logins
          }
          if scopes:
              params["scopes"] = OAuthScopes.serialize(scopes)
          if redirect_uri:
              params["redirect_uri"] = redirect_uri
          split[4] = urlencode(params)
          return urlunparse(split)
docs: Generates a url to send users so that they may authenticate to this
          application.  This url is suitable for redirecting a user to.  For
          example, in `Flask`_, a login route might be implemented like this::
  
             @app.route("/login")
             def begin_oauth_login():
                 login_client = LinodeLoginClient(client_id, client_secret)
                 return redirect(login_client.generate_login_url())
  
          .. _Flask:: http://flask.pocoo.org
  
          :param scopes: The OAuth scopes to request for this login.
          :type scopes: list
          :param redirect_uri: The requested redirect uri.  The login service
                               enforces that this is under the registered redirect
                               path.
          :type redirect_uri: str
  
          :returns: The uri to send users to for this login attempt.
          :rtype: str