<commit_before>cbecc.controller('SpacesCtrl', [
  '$scope', '$location', 'uiGridConstants','toaster', 'Shared', 'data', /*'constData', 'fenData',*/ 'stories', 'spaces', 'constructions', function ($scope, $location, uiGridConstants, toaster, Shared, data, /*constData, fenData,*/ stories, spaces, constructions) {
    $scope.data = {
      /*constData: constData,
       fenData: fenData,*/
      stories: stories,
      spaces: spaces,
      constructions: constructions,
      surfaces: [],
      subsurfaces: []
    };

    // Check for construction defaults
    if ($scope.data.constructions.length) {
      $scope.data.constructions = $scope.data.constructions[0];
    } else {
      $scope.data.constructions = null;
    }

    $scope.data.storiesArr = [];
    $scope.data.storiesHash = {};
    _.each($scope.data.stories, function (story) {
      $scope.data.storiesArr.push({
        id: story.id,
        value: story.name
      });
      $scope.data.storiesHash[story.id] = story.name;
    });

    // TODO Test this when spaces can be saved and loaded
    // Delete spaces that belong to nonexistent stories
    $scope.data.spaces = _.filter($scope.data.spaces, function (space) {
      return $scope.data.storiesHash.hasOwnProperty(space.building_story_id);
    });

    $scope.tabs = [{<commit_msg>retrieving spaces<commit_after>cbecc.controller('SpacesCtrl', [
  '$scope', '$location', 'uiGridConstants','toaster', 'Shared', 'data', /*'constData', 'fenData',*/ 'stories', 'spaces', 'constructions', function ($scope, $location, uiGridConstants, toaster, Shared, data, /*constData, fenData,*/ stories, spaces, constructions) {
    $scope.data = {
      /*constData: constData,
       fenData: fenData,*/
      stories: stories,
      spaces: spaces,
      constructions: constructions,
      surfaces: [],
      subsurfaces: []
    };

    console.log("Saved Spaces:");
    console.log($scope.data.spaces);

    // Check for construction defaults
    if ($scope.data.constructions.length) {
      $scope.data.constructions = $scope.data.constructions[0];
    } else {
      $scope.data.constructions = null;
    }

    $scope.data.storiesArr = [];
    $scope.data.storiesHash = {};
    _.each($scope.data.stories, function (story) {
      $scope.data.storiesArr.push({
        id: story.id,
        value: story.name
      });
      $scope.data.storiesHash[story.id] = story.name;
    });

    // TODO Test this when spaces can be saved and loaded
    // Delete spaces that belong to nonexistent stories
    $scope.data.spaces = _.filter($scope.data.spaces, function (space) {
      return $scope.data.storiesHash.hasOwnProperty(space.building_story_id);
    });

    $scope.tabs = [{
{'fraction_non_alphanumeric': 0.15578635014836795, 'fraction_numerical': 0.000741839762611276, 'mean_word_length': 3.0863636363636364, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2399999', 'n_tokens_mistral': 836, 'n_tokens_neox': 817, 'n_words': 170}