<commit_before><!doctype html>
<html lang=en>
  <head>
    <meta charset=utf-8 />
    <title>Ad-ops uploader</title>
    <style>
      body {
        background: #fcfcfc;
        border: 0;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        margin: 0;
        padding: 0;
      }

      #void {
        left: -100vw;
        position: absolute;
        top: 0;
      }

      #upload_notification {
        color: #00753F;
        visibility: hidden;
        text-align: center;
      }

      form {
        margin: 0 auto;
        max-width: 500px;
        width: 75%;
      }

      fieldset {
        background: #f0f0f0;
        border: 0;
        margin: 100px 0 0 0;
        padding: 40px;
      }

      fieldset legend {
        font-size: 32px;
      }

      fieldset small {
        color: #222;
        display: block;
        padding: 6px;
      }

      fieldset label {
        font-size: 18px;
        color: #222;
        display: inline-block;
        margin: 50px 0 0 0;
        width: 70px;
      }
      fieldset label:first-of-type { margin: 0; }

      fieldset input[type='text'],
      fieldset input[type='number'] {
        font-size: 24px;
        padding: 8px;
      }

      input[type='submit'] {
        background: #e9e9e9;
        border: 0;
        border-radius: 5px;
        display: block;
        font-size: 24px;
        margin: 40px auto 0;
        padding: 10px 15px;
      }

      #copy_url {
        display: block;
        margin: 0 auto;
      }
    </style>
    <script>
      function copy(text) {
        const el = document.createElement('textarea');
        document.getElementById('void').appendChild(el);
        el.textContent = text;

        window.getSelection().removeAllRanges();
        el.select();
        document.execCommand('copy');
        // document.getElementById('void').removeChild(el);
      }

      function getStuff() {
        return new Promise((resolve, reject) => {
          const url = `https://${window.location.host}/v1/browser-based-upload`;

          fetch(url)
            .then(response => response.json())
            .then(data => resolve(data))
            .catch(e => reject(e));
        });
      }

      function validate() {
        if (!document.getElementById('s3_upload').getAttribute('action')) { return; }

        if (!document.getElementById('s3_policy').value) { return; }
        if (!document.getElementById('s3_amz_signature').value) { return; }
        if (!document.getElementById('s3_success_action_redirect').value) { return; }

        if (!document.getElementById('s3_object_key').value) { return; }
        if (!document.getElementById('s3_object_content_type').value) { return; }

        document.getElementById('s3_submit').removeAttribute('disabled');
      }

      (function () {
        document.addEventListener('DOMContentLoaded', _ => {
          const l = window.location;
          document.getElementById('s3_success_action_redirect').value = `${l.protocol}//${l.host}${l.pathname}`;

          const copy_button = document.getElementById('copy_url');
          copy_button.addEventListener('click', ev => {
            const u = document.getElementById('public_url');
            copy(u.innerText);
          });

          if (window.location.href.includes('etag=')) {
            document.getElementById('upload_notification').style.visibility = 'visible';

            const params = new URLSearchParams(window.location.search);
            const u = document.getElementById('public_url');
            u.innerText = `${u.innerText}${encodeURIComponent(params.get('key'))}`;<commit_msg>Improve key decoding/encoding for S3 uploaader<commit_after><!doctype html>
<html lang=en>
  <head>
    <meta charset=utf-8 />
    <title>Ad-ops uploader</title>
    <style>
      body {
        background: #fcfcfc;
        border: 0;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        margin: 0;
        padding: 0;
      }

      #void {
        left: -100vw;
        position: absolute;
        top: 0;
      }

      #upload_notification {
        color: #00753F;
        visibility: hidden;
        text-align: center;
      }

      form {
        margin: 0 auto;
        max-width: 500px;
        width: 75%;
      }

      fieldset {
        background: #f0f0f0;
        border: 0;
        margin: 100px 0 0 0;
        padding: 40px;
      }

      fieldset legend {
        font-size: 32px;
      }

      fieldset small {
        color: #222;
        display: block;
        padding: 6px;
      }

      fieldset label {
        font-size: 18px;
        color: #222;
        display: inline-block;
        margin: 50px 0 0 0;
        width: 70px;
      }
      fieldset label:first-of-type { margin: 0; }

      fieldset input[type='text'],
      fieldset input[type='number'] {
        font-size: 24px;
        padding: 8px;
      }

      input[type='submit'] {
        background: #e9e9e9;
        border: 0;
        border-radius: 5px;
        display: block;
        font-size: 24px;
        margin: 40px auto 0;
        padding: 10px 15px;
      }

      #copy_url {
        display: block;
        margin: 0 auto;
      }
    </style>
    <script>
      function copy(text) {
        const el = document.createElement('textarea');
        document.getElementById('void').appendChild(el);
        el.textContent = text;

        window.getSelection().removeAllRanges();
        el.select();
        document.execCommand('copy');
        // document.getElementById('void').removeChild(el);
      }

      function getStuff() {
        return new Promise((resolve, reject) => {
          const url = `https://${window.location.host}/v1/browser-based-upload`;

          fetch(url)
            .then(response => response.json())
            .then(data => resolve(data))
            .catch(e => reject(e));
        });
      }

      function validate() {
        if (!document.getElementById('s3_upload').getAttribute('action')) { return; }

        if (!document.getElementById('s3_policy').value) { return; }
        if (!document.getElementById('s3_amz_signature').value) { return; }
        if (!document.getElementById('s3_success_action_redirect').value) { return; }

        if (!document.getElementById('s3_object_key').value) { return; }
        if (!document.getElementById('s3_object_content_type').value) { return; }

        document.getElementById('s3_submit').removeAttribute('disabled');
      }

      (function () {
        document.addEventListener('DOMContentLoaded', _ => {
          const l = window.location;
          document.getElementById('s3_success_action_redirect').value = `${l.protocol}//${l.host}${l.pathname}`;

          const copy_button = document.getElementById('copy_url');
          copy_button.addEventListener('click', ev => {
            const u = document.getElementById('public_url');
            copy(u.innerText);
          });

          if (window.location.href.includes('etag=')) {
            document.getElementById('upload_notification').style.visibility = 'visible';

            const params = new URLSearchParams(window.location.search);
            const u = document.getElementById('public_url');
            u.innerText = `${u.innerText}${encodeURI(params.get('key'))}`;
{'fraction_non_alphanumeric': 0.13622754491017963, 'fraction_numerical': 0.021094175285792053, 'mean_word_length': 2.020550760378134, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 33, 'https://': 2, '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': '257602', 'n_tokens_mistral': 2272, 'n_tokens_neox': 2113, 'n_words': 416}