<commit_before>
/**
 * the user has some base layers saved
 */
cdb.admin.UserLayers = cdb.admin.Layers.extend({
  url: function() {
    return '/api/v1/users/' +  this.user.id + '/layers';
  }
});

cdb.admin.User = cdb.core.Model.extend({

  urlRoot: '/api/v1/users',

  initialize: function() {
    if (this.get("get_layers")) {
      this.layers = new cdb.admin.UserLayers();
      this.layers.user = this;
      this._fetchLayers();
    }
  },

  _fetchLayers: function() {
    this.layers.fetch({add: true});
  }
});

<commit_msg>added organization model to user CDB-3097<commit_after>
/**
 * the user has some base layers saved
 */
cdb.admin.UserLayers = cdb.admin.Layers.extend({
  url: function() {
    return '/api/v1/users/' +  this.user.id + '/layers';
  }
});

cdb.admin.User = cdb.core.Model.extend({

  urlRoot: '/api/v1/users',

  initialize: function() {
    if (this.get("get_layers")) {
      this.layers = new cdb.admin.UserLayers();
      this.layers.user = this;
      this._fetchLayers();
    }

    if (this.get('organization')) {
      this.organization = new cdb.admin.Organization(this.get('organization'));
      //TODOMU: remove this
      this.organization.users.add([
        {
          username: 'test1'
        },
        {
          username: 'test2'
        },
        {
          username: 'test3'
        }
      ])
    }

  },

  _fetchLayers: function() {
    this.layers.fetch({add: true});
  }
});


{'fraction_non_alphanumeric': 0.17303683113273105, 'fraction_numerical': 0.007644197359277276, 'mean_word_length': 2.3179723502304146, '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': '2226246', 'n_tokens_mistral': 524, 'n_tokens_neox': 497, 'n_words': 88}