code: def notebook_authenticate(cmd_args, force=False, silent=True):
      
      server = server_url(cmd_args)
      network.check_ssl()
      access_token = None
      if not force:
          try:
              access_token = refresh_local_token(server)
          except OAuthException as e:
              # Account for Invalid Grant Error During make_token_post
              if not silent:
                  raise e
              return notebook_authenticate(cmd_args, force=True, silent=False)
  
      if not access_token:
          access_token = perform_oauth(
              get_code_via_terminal,
              cmd_args,
              copy_msg=NOTEBOOK_COPY_MESSAGE,
              paste_msg=NOTEBOOK_PASTE_MESSAGE)
  
      # Always display email
      email = display_student_email(cmd_args, access_token)
      if email is None and not force:
          return notebook_authenticate(cmd_args, force=True)  # Token has expired
      elif email is None:
          # Did not get a valid token even after a fresh login
          log.warning('Could not get login email. You may have been logged out. '
                      ' Try logging in again.')
      return access_token
docs: Similiar to authenticate but prints student emails after
      all calls and uses a different way to get codes. If SILENT is True,
      it will suppress the error message and redirect to FORCE=True