<commit_before>var dropchop = (function(dc) {
  
  'use strict';

  dc = dc || {};
  dc.ops = dc.ops || {};

  dc.ops.file = {
    'save-geojson': {
      minFeatures: 1,
      description: 'Save as GeoJSON',
      icon: '<i class="fa fa-file-code-o"></i>',
      parameters: [
        {
          name: 'filename',
          description :'Filename prefix to write',
          default: 'dnc'
        }
      ],
      createsLayer: false,
      execute: function() {
        $(dc.selection.list).each(function(i) {
          var content = JSON.stringify(dc.selection.list[i].raw);
          var title = 'dropchop_' + dc.selection.list[i].name + '.geojson';
          saveAs(new Blob([content], {
            type: 'text/plain;charset=utf-8'
          }), title);

        });
      }
    },

    'save-shapefile': {
        minFeatures: 1,
        description: 'Save as Shapefile',
        icon: '<i class="fa fa-file"></i>',
        createsLayer: false
    },

    remove: {
        minFeatures: 1,
        description: 'Remove selected layers',
        icon: '<i class="fa fa-trash-o"></i>',
        disableForm: true,
    },
    upload: {
        description: 'Upload from your computer',
        icon: '<i class="fa fa-upload"></i>',
        parameters: [
            {
                description: 'File to upload.',
                type: 'file',
                extra: 'multiple',
            }
        ]
    },

    'load-url': {
        description: 'Import file from a URL',
        icon: '<i class="fa fa-link"></i>',
        parameters: [
            {
                name: 'url',
                description :'URL',
                type: 'text',
                default: 'http://',
            },
        ],
    },

    'load-gist': {
        description: 'Import files from Gist',
        icon: '<i class="fa fa-github"></i>',
        parameters: [
            {
                name: 'gist',
                description :'Gist ID or URL',
                type: 'text',
            },
        ],
    }
  };

  return dc;

})(dropchop || {});<commit_msg>download as shapefile (kind of), #170<commit_after>var dropchop = (function(dc) {
  
  'use strict';

  dc = dc || {};
  dc.ops = dc.ops || {};

  dc.ops.file = {
    'save-geojson': {
      minFeatures: 1,
      description: 'Save as GeoJSON',
      icon: '<i class="fa fa-file-code-o"></i>',
      parameters: [
        {
          name: 'filename',
          description :'Filename prefix to write',
          default: 'dnc'
        }
      ],
      createsLayer: false,
      execute: function() {
        $(dc.selection.list).each(function(i) {
          var content = JSON.stringify(dc.selection.list[i].raw);
          var title = 'dropchop_' + dc.selection.list[i].name + '.geojson';
          saveAs(new Blob([content], {
            type: 'text/plain;charset=utf-8'
          }), title);

        });
      }
    },

    'save-shapefile': {
        minFeatures: 1,
        description: 'Save as Shapefile',
        icon: '<i class="fa fa-file"></i>',
        execute: function() {
          $(dc.selection.list).each(function(i) {
            try {
              var options = {
                folder: 'dropchop_' + dc.selection.list[i].name,
                types: {
                  point: 'dropchop_' + dc.selection.list[i].name + '_point',
                  polygon: 'dropchop_' + dc.selection.list[i].name + '_poly',
                  line: 'dropchop_' + dc.selection.list[i].name + '_line'
                }
              };
              shpwrite.download(dc.selection.list[i].raw, options);
            } catch (err) {
              dc.notify('Error', 'There was a problem downloading the shapefile.' + err);
              throw err;
            }
          });
        },
        createsLayer: false
    },

    remove: {
        minFeatures: 1,
        description: 'Remove selected layers',
        icon: '<i class="fa fa-trash-o"></i>',
        disableForm: true,
    },
    upload: {
        description: 'Upload from your computer',
        icon: '<i class="fa fa-upload"></i>',
        parameters: [
            {
                description: 'File to upload.',
                type: 'file',
                extra: 'multiple',
            }
        ]
    },

    'load-url': {
        description: 'Import file from a URL',
        icon: '<i class="fa fa-link"></i>',
        parameters: [
            {
                name: 'url',
                description :'URL',
                type: 'text',
                default: 'http://',
            },
        ],
    },

    'load-gist': {
        description: 'Import files from Gist',
        icon: '<i class="fa fa-github"></i>',
        parameters: [
            {
                name: 'gist',
                description :'Gist ID or URL',
                type: 'text',
            },
        ],
    }
  };

  return dc;

})(dropchop || {});
{'fraction_non_alphanumeric': 0.15752864157119476, 'fraction_numerical': 0.0022504091653027824, 'mean_word_length': 1.4048204623708804, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4597367', 'n_tokens_mistral': 1476, 'n_tokens_neox': 1422, 'n_words': 316}