<commit_before>
L.Polygon = L.Polyline.extend({

	options: {
		fill: true
	},

	addLatLng: function (latlng) {
		// TODO with rings
	},

	spliceLatLngs: function () {
		// TODO with rings
	},

	getBounds: function () {
		var flat = this._latlngs[0] instanceof L.LatLng;
		return new L.LatLngBounds(flat ? this._latlngs : this._latlngs[0]);
	},

	_convertLatLngs: function (latlngs) {
		var target = [],
		    flat = !L.Util.isArray(latlngs[0]) || typeof latlngs[0][0] === 'number',
		    len = latlngs.length;

		for (var i = 0; i < len; i++) {
			target[i] = flat ?
					L.latLng(latlngs[i]) :
					this._convertLatLngs(latlngs[i]);
		}

		if (flat && len >= 2 && target[0].equals(target[len - 1])) {
			target.pop();
		}

		return target;
	},

	_clipPoints: function () {
		var points = this._originalPoints,
		    bounds = this._renderer._bounds,
		    parts = points[0] instanceof L.Point ? [points] : points;

		this._parts = [];

		if (this.options.noClip) { return; }

		for (var i = 0, len = parts.length; i < len; i++) {
			var clipped = L.PolyUtil.clipPolygon(parts[i], bounds);
			if (clipped.length) {
				this._parts.push(clipped);
			}
		}
	},

	_updatePath: function () {
		this._renderer._updatePoly(this, true);
	}
});

L.polygon = function (latlngs, options) {
	return new L.Polygon(latlngs, options);
};<commit_msg>fix stroke appearing on polygon clip edges<commit_after>
L.Polygon = L.Polyline.extend({

	options: {
		fill: true
	},

	addLatLng: function (latlng) {
		// TODO with rings
	},

	spliceLatLngs: function () {
		// TODO with rings
	},

	getBounds: function () {
		var flat = this._latlngs[0] instanceof L.LatLng;
		return new L.LatLngBounds(flat ? this._latlngs : this._latlngs[0]);
	},

	_convertLatLngs: function (latlngs) {
		var target = [],
		    flat = !L.Util.isArray(latlngs[0]) || typeof latlngs[0][0] === 'number',
		    len = latlngs.length;

		for (var i = 0; i < len; i++) {
			target[i] = flat ?
					L.latLng(latlngs[i]) :
					this._convertLatLngs(latlngs[i]);
		}

		if (flat && len >= 2 && target[0].equals(target[len - 1])) {
			target.pop();
		}

		return target;
	},

	_clipPoints: function () {
		var points = this._originalPoints,
		    bounds = this._renderer._bounds,
		    parts = points[0] instanceof L.Point ? [points] : points,
		    w = this.options.weight,
		    p = new L.Point(w, w);

		// increase clip padding by stroke width to avoid stroke on clip edges
		bounds = new L.Bounds(bounds.min.subtract(p), bounds.max.add(p));

		this._parts = [];

		if (this.options.noClip) { return; }

		for (var i = 0, len = parts.length; i < len; i++) {
			var clipped = L.PolyUtil.clipPolygon(parts[i], bounds);
			if (clipped.length) {
				this._parts.push(clipped);
			}
		}
	},

	_updatePath: function () {
		this._renderer._updatePoly(this, true);
	}
});

L.polygon = function (latlngs, options) {
	return new L.Polygon(latlngs, options);
};
{'fraction_non_alphanumeric': 0.16557433597792343, 'fraction_numerical': 0.0075888237323214905, 'mean_word_length': 3.1193181818181817, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '5259353', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1100, 'n_words': 240}