<commit_before>var ms = require("../ms.js");

module.exports = function(ratio) {
  function processCanvasInstructions(instruction, ctx) {
    for (var i = 0; i < instruction.length; i++) {
      if (Array.isArray(instruction[i])) {
        if (instruction[i].length) {
          processCanvasInstructions.call(this, instruction[i], ctx);
        }
      } else {
        if (typeof instruction[i] === "object") {
          ctx.lineWidth = instruction[i].strokewidth || this.style.strokeWidth;
          if (typeof instruction[i].stroke !== "undefined") {
            if (instruction[i].stroke) {
              ctx.strokeStyle = instruction[i].stroke;
            } else {
              ctx.strokeStyle = "rgba(0,0,0,0)";
            }
          }
          if (instruction[i].strokedasharray) {
            ctx.setLineDash(instruction[i].strokedasharray.split(","));
          } else {
            if (ctx.getLineDash().length != 0) {
              ctx.setLineDash([]);
            }
          }
          if (instruction[i].linecap) {
            ctx.lineCap = instruction[i].linecap;
            ctx.lineJoin = instruction[i].linecap;
          }
          if (instruction[i].fill) {
            ctx.fillStyle = instruction[i].fill;
          }
          //fill is set to false, make it transparent
          if (!instruction[i].fill) {
            ctx.fillStyle = "rgba(0,0,0,0)";
          }

          if (typeof instruction[i].fillopacity !== "undefined") {
            ctx.globalAlpha = instruction[i].fillopacity;
          }

          switch (instruction[i].type) {
            case "path":
              try {
                var d = new Path2D(instruction[i].d);
                if (
                  typeof instruction[i].fill === "undefined" ||
                  (typeof instruction[i].fill !== "undefined" &&
                    instruction[i].fill)
                )
                  ctx.fill(d);
                if (
                  typeof instruction[i].stroke === "undefined" ||
                  (typeof instruction[i].stroke !== "undefined" &&
                    instruction[i].stroke)
                )
                  ctx.stroke(d);
              } catch (err) {
                if (typeof ms._Path2D === "function") {
                  ms._Path2D(ctx, instruction[i].d);
                  if (
                    typeof instruction[i].fill === "undefined" ||
                    (typeof instruction[i].fill !== "undefined" &&
                      instruction[i].fill)
                  )
                    ctx.fill();
                  if (
                    typeof instruction[i].stroke === "undefined" ||
                    (typeof instruction[i].stroke !== "undefined" &&
                      instruction[i].stroke)
                  )
                    ctx.stroke();
                } else {
                  console.warn(
                    "ms._Path2D() is not present, you will need to load functionality for using Canvas in older version of Internet Explorer."
                  );
                }
              }
              break;
            case "circle":
              ctx.beginPath();
              ctx.arc(<commit_msg>Revert "Fix canvas error in newer versions of Edge"<commit_after>var ms = require("../ms.js");

module.exports = function(ratio) {
  function processCanvasInstructions(instruction, ctx) {
    for (var i = 0; i < instruction.length; i++) {
      if (Array.isArray(instruction[i])) {
        if (instruction[i].length) {
          processCanvasInstructions.call(this, instruction[i], ctx);
        }
      } else {
        if (typeof instruction[i] === "object") {
          ctx.lineWidth = instruction[i].strokewidth || this.style.strokeWidth;
          if (typeof instruction[i].stroke !== "undefined") {
            if (instruction[i].stroke) {
              ctx.strokeStyle = instruction[i].stroke;
            } else {
              ctx.strokeStyle = "rgba(0,0,0,0)";
            }
          }
          if (instruction[i].strokedasharray) {
            ctx.setLineDash(instruction[i].strokedasharray.split(","));
          } else {
            if (ctx.getLineDash().length != 0) {
              ctx.setLineDash([]);
            }
          }
          if (instruction[i].linecap) {
            ctx.lineCap = instruction[i].linecap;
            ctx.lineJoin = instruction[i].linecap;
          }
          if (instruction[i].fill) {
            ctx.fillStyle = instruction[i].fill;
          }
          //fill is set to false, make it transparent
          if (!instruction[i].fill) {
            ctx.fillStyle = "rgba(0,0,0,0)";
          }

          if (typeof instruction[i].fillopacity !== "undefined") {
            ctx.globalAlpha = instruction[i].fillopacity;
          }

          switch (instruction[i].type) {
            case "path":
              if (typeof Path2D != "undefined") {
                var d = new Path2D(instruction[i].d);
                if (
                  typeof instruction[i].fill === "undefined" ||
                  (typeof instruction[i].fill !== "undefined" &&
                    instruction[i].fill)
                )
                  ctx.fill(d);
                if (
                  typeof instruction[i].stroke === "undefined" ||
                  (typeof instruction[i].stroke !== "undefined" &&
                    instruction[i].stroke)
                )
                  ctx.stroke(d);
              } else {
                if (typeof ms._Path2D === "function") {
                  ms._Path2D(ctx, instruction[i].d);
                  if (
                    typeof instruction[i].fill === "undefined" ||
                    (typeof instruction[i].fill !== "undefined" &&
                      instruction[i].fill)
                  )
                    ctx.fill();
                  if (
                    typeof instruction[i].stroke === "undefined" ||
                    (typeof instruction[i].stroke !== "undefined" &&
                      instruction[i].stroke)
                  )
                    ctx.stroke();
                } else {
                  console.warn(
                    "ms._Path2D() is not present, you will need to load functionality for using Canvas in older version of Internet Explorer."
                  );
                }
              }
              break;
            case "circle":
              ctx.beginPath();
              ctx.arc(
{'fraction_non_alphanumeric': 0.12864039869179256, 'fraction_numerical': 0.004516430462544775, 'mean_word_length': 1.3067528735632183, 'pattern_counts': {'":': 4, '<': 5, '<?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': '2722267', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1581, 'n_words': 321}