Savitzky-Golay filter
@param {Array <number>} data
@param {number} h
@param {Object} options
@returns {Array}
191294
function SavitzkyGolay (data, h, options) {
                options = extend({}, defaultOptions$p, options);
                if ((options.windowSize % 2 === 0) || (options.windowSize < 5) || !(Number.isInteger(options.windowSize)))
                    throw new RangeError('Invalid window size (should be odd and at least 5 integer number)');
                if ((options.derivative < 0) || !(Number.isInteger(options.derivative)))
                    throw new RangeError('Derivative should be a positive integer');
                if ((options.polynomial < 1) || !(Number.isInteger(options.polynomial)))
                    throw new RangeError('Polynomial should be a positive integer');

                var C, norm;
                var step = Math.floor(options.windowSize / 2);

                if (options.pad === 'pre') {
                    data = src$i(data, {size: step, value: options.padValue});
                }

                var ans =  new Array(data.length - 2*step);

                if ((options.windowSize === 5) && (options.polynomial === 2) && ((options.derivative === 1) || (options.derivative === 2))) {
                    if (options.derivative === 1) {
                        C = [-2,-1,0,1,2];
                        norm = 10;
                    }
                    else {
                        C = [2, -1, -2, -1, 2];
                        norm = 7;
                    }
                }
                else {
                    var J = Matrix$9.ones(options.windowSize, options.polynomial + 1);
                    var inic = -(options.windowSize - 1) / 2;
                    for (var i = 0; i < J.length; i++) {
                        for (var j = 0; j < J[i].length; j++) {
                            if ((inic + 1 !== 0) || (j !== 0))
                                J[i][j] = Math.pow((inic + i), j);
                        }
                    }
                    var Jtranspose = J.transposeView();
                    var Jinv = inverse$4(Jtranspose.mmul(J));
                    C = Jinv.mmul(Jtranspose);
                    C = C[options.derivative];
                    norm = 1;
                }
                var det = norm * Math.pow(h, options.derivative);
                for (var k = step; k < (data.length - step); k++) {
                    var d = 0;
                    for (var l = 0; l < C.length; l++)
                        d += C[l] * data[l + k - step] / det;
                    ans[k - step] = d;
                }

                if (options.pad === 'post') {
                    ans = src$i(ans, {size: step, value: options.padValue});
                }

                return ans;
            }
667029
function(data, param) {
              var eol = getEol(data,param);
              var lines = data.split(eol);
              var partial = lines.pop();
              return {lines: lines, partial: partial};
            }
340834
function (data) {
	var tempColorFunction = new L.PiecewiseFunction([new L.HSLHueFunction(new L.Point(100,270), new L.Point(210,270), {outputLuminosity: '25%'}), new L.HSLHueFunction(new L.Point(210,270), new L.Point(320,0), {outputLuminosity: '25%'})]);
	var tempFillColorFunction = new L.PiecewiseFunction([new L.HSLHueFunction(new L.Point(100,270), new L.Point(210,270), {outputLuminosity: '50%'}), new L.HSLHueFunction(new L.Point(210,270), new L.Point(320,0), {outputLuminosity: '50%'})]);
	var radiusFunction = new L.LinearFunction(new L.Point(272,5), new L.Point(320,15));
	var K_TO_C = 273.15;
	var convert = function (value) {
		var celsius = value - K_TO_C;
		var farenheit = (9/5) * celsius + 32;
		
		return {
			c: celsius,
			f: farenheit
		};
	};
	
	var options = {
		recordsField: 'list',
		latitudeField: 'coord.lat',
		longitudeField: 'coord.lon',
		displayOptions: {
			'main.temp': {
				displayName: 'Temperature',
				color: tempColorFunction,
				fillColor: tempFillColorFunction,
				radius: radiusFunction,
				displayText: function (value) {
					var values = convert(value);
					
					return values.f.toFixed(0) + '&deg;F / ' + values.c.toFixed(0) + '&deg;C';
				}
			}
		},
		layerOptions: {
			width: 5,
			weight: 1,
			iconSize: new L.Point(60,40),
			fillOpacity: 0.8,
			opacity: 1.0,
			radius: 6
		},
		tooltipOptions: {
			iconSize: new L.Point(100,55),
			iconAnchor: new L.Point(-5,55)
		},
		onEachRecord: function (layer,record) {
			var html = '<table class="table table-condensed table-striped table-bordered"><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody></tbody></table>';
			var $html = $(html);
			var $tbody = $html.find('tbody');
			
			for (var property in record.main) {
				$tbody.append('<tr><td>' + property + '</td><td>' + record.main[property] + '</td></tr>');
			}
			layer.bindPopup($html.wrap('<div/>').parent().html(),{
				minWidth: 400,
				maxWidth: 400
			});
		}
	};
	
	var weatherLayer = new L.MapMarkerDataLayer(data, options);

	map.addLayer(weatherLayer);
	
	if (!lastWeatherLayer) {		
		var legend = weatherLayer.getLegend({
			numSegments: 20,
			width: 80,
			className: 'well'
		});
		
		$('#legend').append(legend);
	}
	
	lastWeatherLayer = weatherLayer;
	
}
133862
function readOptions(data, schema) {
    const keys = _.keys(schema.describe().children),
          options = _.pick(data, keys);

    options.url = parseUrl(options.url);
    options.headers = parseHeaders(options.headers);
    options.clipRect = parseClipRect(options.clipRect);

    return _.omitBy(options, (v) => _.isUndefined(v) || _.isNull(v));
}
341445
function Table(options, data) {
        options = options || {};

        // Updates indexes on the fly.
        if (!options.update) options.update = {};

        if ('undefined' === typeof options.update.indexes) {
            options.update.indexes = true;
        }

        NDDB.call(this, options, data);

//         // ### Table.row
//         // NDDB hash containing elements grouped by row index
//         // @see NDDB.hash
//         if (!this.row) {
//             this.hash('row', function(c) {
//                 return c.x;
//             });
//         }
//
//         // ### Table.col
//         // NDDB hash containing elements grouped by column index
//         // @see NDDB.hash
//         if (!this.col) {
//             this.hash('col', function(c) {
//                 return c.y;
//             });
//         }

        // ### Table.rowcol
        // NDDB index to access elements with row.col notation
        // @see NDDB.hash
        if (!this.rowcol) {
            this.index('rowcol', function(c) {
                return c.x + '.' + c.y;
            });
        }

        /**
         * ### Table.pointers
         *
         * References to last inserted cell coordinates
         */
        this.pointers = {
            x: options.pointerX || null,
            y: options.pointerY || null
        };

        /**
         * ### Table.header
         *
         * Array containing the header elements of the table
         */
        this.header = [];

        /**
         * ### Table.footer
         *
         * Array containing the footer elements of the table
         */
        this.footer = [];

        /**
         * ### Table.left
         *
         * Array containing elements to keep on the left border of the table
         */
        this.left = [];

        /**
         * ### Table.table
         *
         * Reference to the HTMLElement Table
         */
        this.table = options.table || document.createElement('table');

        if ('string' === typeof options.id) {
            this.table.id = options.id;
        }
        else if (options.id) {
            throw new TypeError('Table constructor: options.id must be ' +
                                'string or undefined.');
        }

        if ('string' === typeof options.className) {
            this.table.className = options.className;
        }
        else if (J.isArray(options.className)) {
            this.table.className = options.className.join(' ');
        }
        else if (options.className) {
            throw new TypeError('Table constructor: options.className must ' +
                                'be string, array, or undefined.');
        }

        /**
         * ### Table.missingClassName
         *
         * Class name for "missing" cells
         *
         * "Missing" cells are cells that are added automatically to complete
         * the table because one or more cells have been added with higher
         * row and column indexes.
         */
        this.missingClassName = 'missing';

        if ('string' === typeof options.missingClassName) {
            this.missingClassName = options.missingClassName;
        }
        else if (J.isArray(options.missingClassName)) {
            this.missingClassName = options.missingClassName.join(' ');
        }
        else if (options.missingClassName) {
            throw new TypeError('Table constructor: options.className must ' +
                                'be string, array, or undefined.');
        }

        /**
         * ### Table.autoParse
         *
         * If TRUE, whenever a new cell is added the table is updated.
         * Default: FALSE
         */
        this.autoParse = 'undefined' !== typeof options.autoParse ?
            options.autoParse : false;

        /**
         * ### Table.trs
         *
         * List of TR elements indexed by their order in the parsed table
         */
        this.trs = {};

        /**
         * ### Table.trCb
         *
         * Callback function applied to each TR HTML element
         *
         * Callback receives the HTML element, and the row index, or
         * 'thead' and 'tfoot' for header and footer.
         */
        if ('function' === typeof options.tr) {
            this.trCb = options.tr;
        }
        else if ('undefined' === typeof options.tr) {
            this.trCb = null;
        }
        else {
            throw new TypeError('Table constructor: options.tr must be ' +
                                'function or undefined.');
        }

        // Init renderer.
        this.initRenderer(options.render);
    }
630934
function(options) {
  options = options || {};
  
  this.datasources = [];
  this.styles = [];
  this.projection = DEFAULT_PROJECTION;
  this.assetsPath = ".";
  
  if (options.projection){
    this.projection = projector.util.cleanProjString(options.projection);
    console.log(this.projection);
  }
  
  this.boundsBuffer =
    ("boundsBuffer" in options) ? options.boundsBuffer : BUFFER_RATIO;
  
  this._renderer = cartoRenderer;
}
1348507
public function data($data = [], $filter = FILTER_DEFAULT, $options = [])
    {
        $sanitized = new static($data, $filter, $options, new Validate);

        return $sanitized->getData();
    }
875169
function filterPoints (data, start, end) {
  if (!end) {
    end = start
  }

  var node = start,
    again
  do {
    again = false

    if (!node.steiner && (equals(data, node.i, node.next.i) || orient(data, node.prev.i, node.i, node.next.i) === 0)) {

      // remove node
      node.prev.next = node.next
      node.next.prev = node.prev

      if (node.prevZ) {
        node.prevZ.nextZ = node.nextZ
      }
      if (node.nextZ) {
        node.nextZ.prevZ = node.prevZ
      }

      node = end = node.prev

      if (node === node.next) {
        return null
      }
      again = true

    } else {
      node = node.next
    }
  } while (again || node !== end)

  return end
}
491286
def vertical_horizontal_filter(data, period):
    
    catch_errors.check_for_period_error(data, period)

    vhf = [abs(np.max(data[idx+1-period:idx+1]) -
            np.min(data[idx+1-period:idx+1])) /
        sum([abs(data[idx+1-period:idx+1][i] - data[idx+1-period:idx+1][i-1]) for i in range(0, len(data[idx+1-period:idx+1]))]) for idx in range(period - 1, len(data))]

    vhf = fill_for_noncomputable_vals(data, vhf)
    return vhf
1273376
function filter(pred) {
  return function(xs) {
    var output = [];
    for (var idx = 0; idx < xs.length; idx += 1) {
      if (pred (xs[idx])) {
        output.push (xs[idx]);
      }
    }
    return output;
  };
}
423620
function filterDataItem(item){
    return this.filters.some(function(filter){
      return filter.call(null, item);
    }) ? item : null;
  }
552770
function get(data) {
    var parser = this
      , matches = [];

    //
    // Another npm oddity, it allows licenses to be specified in to different
    // properties. Because why the fuck not?
    //
    ['license', 'licenses'].forEach(function each(key) {
      if ('string' === typeof data[key]) {
        return matches.push(data[key]);
      }

      if (Array.isArray(data[key])) {
        return Array.prototype.push.apply(
          matches,
          data[key].map(function map(item) {
            return parser.license(item);
          }).filter(Boolean)
        );
      }

      if ('object' === typeof data[key] && parser.license(data[key])) {
        return Array.prototype.push.apply(
          matches,
          [parser.license(data[key])]
        );
      }
    });

    if (matches.length) return matches;
  }
48432
function filterOptions(options, value)
{
	// If the input value is `undefined` or empty.
	if (!value) {
		return options
	}

	value = value.toLowerCase()

	return options.filter(({ label }) => label.toLowerCase().indexOf(value) >= 0)
}
783633
function filter(name, options) {
  return utils.through.obj(function(file, enc, next) {
    if (file.isNull()) {
      next();
      return;
    }

    var basename = path.basename(file.history[0]);
    var stem = basename.slice(0, -3);

    if (basename === name || stem === name) {
      next(null, file);
    } else {
      next();
    }
  });
}
1228276
def filter_data(self, data, value=None, args=None):
        """"""
        if args:
            if not args.last:
                return data
        if not value: value = args.last
        # Set the units and number from the option:
        lastunit = value[-1]
        lastnum = value[:-1]
        
        # Set the start time:
        if lastunit == 's':
            starttime = datetime.utcnow() - \
                    timedelta(seconds=int(lastnum))
        if lastunit == 'm':
            starttime = datetime.utcnow() - \
                    timedelta(minutes=int(lastnum))
        if lastunit == 'h':
            starttime = datetime.utcnow() - \
                    timedelta(hours=int(lastnum))
        if lastunit == 'd':
            starttime = datetime.utcnow() - \
                    timedelta(days=int(lastnum))
        ourstart = int(starttime.strftime('%Y%m%d%H%M%S'))
        
        # Pull out the specified time period:
        newdata = {}
        if 'parser' in data.keys():
            newdata['parser'] = data['parser']
            newdata['source_path'] = data['source_path']
            newdata['source_file'] = data['source_file']
            newdata['source_file_mtime'] = data['source_file_mtime']
            newdata['source_file_year'] = data['source_file_year']
        newdata['entries'] = []

        for entry in data['entries']:
            if 'numeric_date_stamp_utc' in entry.keys():
                if '.' in entry['numeric_date_stamp_utc']:
                    dstamp = int(entry['numeric_date_stamp_utc'].split('.')[0])
                else:
                    dstamp = int(entry['numeric_date_stamp_utc'])
                if dstamp >= ourstart: 
                    newdata['entries'].append(entry)

        return newdata
780413
function dataAlasis(d, k, l) {
    k = k || [];
    if (Array.isArray(d)) {
        var key = k[l];
        for (var i = 0; i < d.length; i++) {
            var item = d[i];
            var crtData = item[key] || [];
            l && (l = k.indexOf(key));
            if (l == keyLength - 1) {
                filterCtt.push(crtData);
            }
            else {
                l++;
                arguments.callee(crtData, k, l);
            }
        }
    }
    else {
        var subData = d[k[l]];
        l++;
        if (subData) {
            arguments.callee(subData, k, l);
        }
    }
}
950679
function (x, y, w, h, options) {
			var start = options.start,
				end = options.end,
				radius = options.r || w || h,
				innerRadius = options.innerR,
				cosStart = mathCos(start),
				sinStart = mathSin(start),
				cosEnd = mathCos(end),
				sinEnd = mathSin(end),
				ret;

			if (end - start === 0) { // no angle, don't show it.
				return ['x'];
			}

			ret = [
				'wa', // clockwise arc to
				x - radius, // left
				y - radius, // top
				x + radius, // right
				y + radius, // bottom
				x + radius * cosStart, // start x
				y + radius * sinStart, // start y
				x + radius * cosEnd, // end x
				y + radius * sinEnd  // end y
			];

			if (options.open && !innerRadius) {
				ret.push(
					'e',
					M,
					x,// - innerRadius,
					y// - innerRadius
				);
			}

			ret.push(
				'at', // anti clockwise arc to
				x - innerRadius, // left
				y - innerRadius, // top
				x + innerRadius, // right
				y + innerRadius, // bottom
				x + innerRadius * cosEnd, // start x
				y + innerRadius * sinEnd, // start y
				x + innerRadius * cosStart, // end x
				y + innerRadius * sinStart, // end y
				'x', // finish path
				'e' // close
			);

			ret.isArc = true;
			return ret;

		}