<commit_before>/**
 * Service for providing access to the backend API via HTTP.
 */

angular.module('pipelineAgentApp.common')
  .factory('api', function($rootScope, $http) {
    var apiBase = 'rest/v1',
      api = {events: {}};

    api.pipelineAgent = {

      getDefinitions: function() {
        var url = apiBase + '/definitions';
        return $http({
          method: 'GET',
          url: url
        });
      },

      getPipelineConfig: function(name) {
        var url;

        if(!name) {
          name = 'xyz';
        }

        url = apiBase + '/pipelines/' + name;
        return $http({
          method: 'GET',
          url: url
        });
      },

      getPipelineConfigInfo: function(name) {
        var url;

        if(!name) {
          name = 'xyz';
        }

        url = apiBase + '/pipelines/' + name + '?get=info';
        return $http({
          method: 'GET',
          url: url
        });
      },

      savePipelineConfig: function(name, config) {
        var url;

        if(!name) {
          name = 'xyz';
        }

        url = apiBase + '/pipelines/' + name;
        return $http({
          method: 'POST',
          url: url,
          data: config
        });
      },

      previewPipeline: function(name, sourceOffset, batchSize, rev) {
        var url;

        if(!name) {
          name = 'xyz';
        }

        if(!sourceOffset) {
          sourceOffset = 0;
        }

        if(!batchSize) {
          batchSize = 10;
        }

        url = apiBase + '/pipelines/' + name + '/preview?sourceOffset' + sourceOffset +
          '&batchSize=' + batchSize + '&rev=' + rev;

        return $http({<commit_msg>Fixed sourceOffset value while calling preview<commit_after>/**
 * Service for providing access to the backend API via HTTP.
 */

angular.module('pipelineAgentApp.common')
  .factory('api', function($rootScope, $http) {
    var apiBase = 'rest/v1',
      api = {events: {}};

    api.pipelineAgent = {

      getDefinitions: function() {
        var url = apiBase + '/definitions';
        return $http({
          method: 'GET',
          url: url
        });
      },

      getPipelineConfig: function(name) {
        var url;

        if(!name) {
          name = 'xyz';
        }

        url = apiBase + '/pipelines/' + name;
        return $http({
          method: 'GET',
          url: url
        });
      },

      getPipelineConfigInfo: function(name) {
        var url;

        if(!name) {
          name = 'xyz';
        }

        url = apiBase + '/pipelines/' + name + '?get=info';
        return $http({
          method: 'GET',
          url: url
        });
      },

      savePipelineConfig: function(name, config) {
        var url;

        if(!name) {
          name = 'xyz';
        }

        url = apiBase + '/pipelines/' + name;
        return $http({
          method: 'POST',
          url: url,
          data: config
        });
      },

      previewPipeline: function(name, sourceOffset, batchSize, rev) {
        var url;

        if(!name) {
          name = 'xyz';
        }

        if(!sourceOffset) {
          sourceOffset = 0;
        }

        if(!batchSize) {
          batchSize = 10;
        }

        url = apiBase + '/pipelines/' + name + '/preview?sourceOffset=' + sourceOffset +
          '&batchSize=' + batchSize + '&rev=' + rev;

        return $http({
{'fraction_non_alphanumeric': 0.14087418783225045, 'fraction_numerical': 0.002362669816893089, 'mean_word_length': 1.46865889212828, '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': '5315067', 'n_tokens_mistral': 1021, 'n_tokens_neox': 966, 'n_words': 236}