<commit_before>angular.module('oauth.nationbuilder', ['oauth.utils'])
  .factory('$ngCordovaNationbuilder', nationbuilder);

function nationbuilder($q, $http, $cordovaOauthUtility) {
  return { signin: oauthNationbuilder };

  /*
   * Sign into the Nationbuilder service
   *
   * @param    string appKey
   * @param    object options
   * @return   promise
   */
  function oauthNationbuilder(appKey, options) {
    var deferred = $q.defer();
    if(window.cordova) {
      if($cordovaOauthUtility.isInAppBrowserInstalled()) {
        var redirect_uri = "http://localhost/oauth_callback";
        if(options !== undefined) {
          if(options.hasOwnProperty("redirect_uri")) {
            redirect_uri = options.redirect_uri;
          }
        }
        var browserRef = window.cordova.InAppBrowser.open("https://gu.nationbuilder.com/oauth/authorize?client_id=" + appKey + "&redirect_uri=" + redirect_uri + "&response_type=token);
        browserRef.addEventListener("loadstart", function(event) {
          if ((event.url).indexOf(redirect_uri) === 0) {
            browserRef.removeEventListener("exit",function(event){});
            browserRef.close();
            var callbackResponse = (event.url).split("#")[1];
            var responseParameters = (callbackResponse).split("&");
            var parameterMap = [];
            for(var i = 0; i < responseParameters.length; i++) {
              parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1];
            }
            if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) {
              deferred.resolve({ access_token: parameterMap.access_token, token_type: parameterMap.token_type, uid: parameterMap.uid });
            } else {
              deferred.reject("Problem authenticating");
            }
          }
        });
        browserRef.addEventListener('exit', function(event) {
          deferred.reject("The sign in flow was canceled");
        });
      } else {<commit_msg>Updated nber to remove typo<commit_after>angular.module('oauth.nationbuilder', ['oauth.utils'])
  .factory('$ngCordovaNationbuilder', nationbuilder);

function nationbuilder($q, $http, $cordovaOauthUtility) {
  return { signin: oauthNationbuilder };

  /*
   * Sign into the Nationbuilder service
   *
   * @param    string appKey
   * @param    object options
   * @return   promise
   */
  function oauthNationbuilder(appKey, options) {
    var deferred = $q.defer();
    if(window.cordova) {
      if($cordovaOauthUtility.isInAppBrowserInstalled()) {
        var redirect_uri = "http://localhost/oauth_callback";
        if(options !== undefined) {
          if(options.hasOwnProperty("redirect_uri")) {
            redirect_uri = options.redirect_uri;
          }
        }
        var browserRef = window.cordova.InAppBrowser.open("https://gu.nationbuilder.com/oauth/authorize?client_id=" + appKey + "&redirect_uri=" + redirect_uri + "&response_type=token");
        browserRef.addEventListener("loadstart", function(event) {
          if ((event.url).indexOf(redirect_uri) === 0) {
            browserRef.removeEventListener("exit",function(event){});
            browserRef.close();
            var callbackResponse = (event.url).split("#")[1];
            var responseParameters = (callbackResponse).split("&");
            var parameterMap = [];
            for(var i = 0; i < responseParameters.length; i++) {
              parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1];
            }
            if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) {
              deferred.resolve({ access_token: parameterMap.access_token, token_type: parameterMap.token_type, uid: parameterMap.uid });
            } else {
              deferred.reject("Problem authenticating");
            }
          }
        });
        browserRef.addEventListener('exit', function(event) {
          deferred.reject("The sign in flow was canceled");
        });
      } else {
{'fraction_non_alphanumeric': 0.1384159881569208, 'fraction_numerical': 0.002467308166790032, 'mean_word_length': 2.7994376757263355, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1849797', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1114, 'n_words': 190}