<commit_before>angular.module(PKG.name + '.services')
  .service('myNamespace', function myNamespace($q, MyDataSource) {

    this.namespaceList = [];

    var data = new MyDataSource(),
        queryInProgress = null;


    this.getList = function (force) {
      if (!force && this.namespaceList.length) {
          return $q.when(this.namespaceList);
      }

      if (!queryInProgress) {

        queryInProgress = $q.defer();

        data.request(
          {
            _cdapPath: '/namespaces',
            method: 'GET'
          },
          (function(res) {
            this.namespaceList = res;
            queryInProgress.resolve(res);
            queryInProgress = null;
          }).bind(this)
        );

      }

      return queryInProgress.promise;
    };

  });<commit_msg>Moves getDisplayName to myNamespace service<commit_after>angular.module(PKG.name + '.services')
  .service('myNamespace', function myNamespace($q, MyDataSource) {

    this.namespaceList = [];

    var data = new MyDataSource(),
        queryInProgress = null;


    this.getList = function (force) {
      if (!force && this.namespaceList.length) {
          return $q.when(this.namespaceList);
      }

      if (!queryInProgress) {

        queryInProgress = $q.defer();

        data.request(
          {
            _cdapPath: '/namespaces',
            method: 'GET'
          },
          (function(res) {
            this.namespaceList = res;
            queryInProgress.resolve(res);
            queryInProgress = null;
          }).bind(this)
        );

      }

      return queryInProgress.promise;
    };

    this.getDisplayName = function(id) {
      var ns = this.namespaceList.filter(function(namespace) {
        return namespace.id === id;
      });
      return ns[0].displayName;
    };

  });
{'fraction_non_alphanumeric': 0.1281767955801105, 'fraction_numerical': 0.0005524861878453039, 'mean_word_length': 1.9209677419354838, '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': '6168078', 'n_tokens_mistral': 523, 'n_tokens_neox': 501, 'n_words': 92}