<commit_before>(function($, cloudStack) {
  cloudStack.lbStickyPolicy = function(args) {
    return function(args) {
      var success = args.response.success;
      var context = args.context;
      var network = args.context.networks[0];

      var lbService = $.grep(network.service, function(service) {
        return service.name == 'Lb';
      })[0];
      var stickinessCapabilities = JSON.parse(
        $.grep(lbService.capability, function(capability) {
          return capability.name == 'SupportedStickinessMethods';
        })[0].value
      );

      var baseFields = {
        name: { label: 'Name', validation: { required: true }, isHidden: true },
        mode: { label: 'Mode', isHidden: true },
        length: { label: 'Length', validation: { required: true }, isHidden: true },
        holdtime: { label: 'Hold Time', validation: { required: true }, isHidden: true },
        tablesize: { label: 'Table size', isHidden: true },
        expire: { label: 'Expire', isHidden: true },
        requestlearn: { label: 'Request-Learn', isBoolean: true, isHidden: true },
        prefix: { label: 'Prefix', isBoolean: true, isHidden: true },
        nocache: { label: 'No cache', isBoolean: true, isHidden: true },
        indirect: { label: 'Indirect', isBoolean: true, isHidden: true },
        postonly: { label: 'Is post-only', isBoolean: true, isHidden: true },
        domain: { label: 'Domain', isBoolean: true, isHidden: true }
      };

      var conditionalFields = {
        methodname: {
          label: 'Stickiness method',
          select: function(args) {
            var $select = args.$select;
            var $form = $select.closest('form');
            var stickyOptions = [
              {
                id: 'none',
                description: 'None'
              }
            ];

            stickinessCapabilities.push({ methodname: 'none', paramlist: [] });
            
            $(stickinessCapabilities).each(function() {
              var stickyCapability = this;
              
              stickyOptions.push({
                id: stickyCapability.methodname,
                description: stickyCapability.methodname
              });
            });

            args.response.success({
              data: stickyOptions
            }, 500);

            $select.change(function() {
              var value = $select.val();<commit_msg>Fix method select field<commit_after>(function($, cloudStack) {
  cloudStack.lbStickyPolicy = function(args) {
    return function(args) {
      var success = args.response.success;
      var context = args.context;
      var network = args.context.networks[0];

      var lbService = $.grep(network.service, function(service) {
        return service.name == 'Lb';
      })[0];
      var stickinessCapabilities = JSON.parse(
        $.grep(lbService.capability, function(capability) {
          return capability.name == 'SupportedStickinessMethods';
        })[0].value
      );

      var baseFields = {
        name: { label: 'Name', validation: { required: true }, isHidden: true },
        mode: { label: 'Mode', isHidden: true },
        length: { label: 'Length', validation: { required: true }, isHidden: true },
        holdtime: { label: 'Hold Time', validation: { required: true }, isHidden: true },
        tablesize: { label: 'Table size', isHidden: true },
        expire: { label: 'Expire', isHidden: true },
        requestlearn: { label: 'Request-Learn', isBoolean: true, isHidden: true },
        prefix: { label: 'Prefix', isBoolean: true, isHidden: true },
        nocache: { label: 'No cache', isBoolean: true, isHidden: true },
        indirect: { label: 'Indirect', isBoolean: true, isHidden: true },
        postonly: { label: 'Is post-only', isBoolean: true, isHidden: true },
        domain: { label: 'Domain', isBoolean: true, isHidden: true }
      };

      var conditionalFields = {
        methodname: {
          label: 'Stickiness method',
          select: function(args) {
            var $select = args.$select;
            var $form = $select.closest('form');
            var stickyOptions = [];

            stickinessCapabilities.push({ methodname: 'None', paramlist: [] });
            $(stickinessCapabilities).each(function() {
              var stickyCapability = this;
              
              stickyOptions.push({
                id: stickyCapability.methodname,
                description: stickyCapability.methodname
              });
            });

            stickyOptions = stickyOptions.sort(function() {
              return this.id != 'None';
            })

            args.response.success({
              data: stickyOptions
            }, 500);

            $select.change(function() {
              var value = $select.val();
{'fraction_non_alphanumeric': 0.13111668757841907, 'fraction_numerical': 0.002509410288582183, 'mean_word_length': 2.089793281653747, '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': '6247739', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1259, 'n_words': 323}