<commit_before>(function ( Popcorn ) {

  var Sketchfab;
  var SketchfabQuery;

  function validateDimension( value, fallback ) {
    if ( typeof value === "number" ) {
      return value;
    }
    return fallback;
  }

  function setupIframe( options ) {
    var iframe, src, iframeOptions;

    if ( options._sketchfabAPI ) {
      options._sketchfabAPI._preventStartFlag = true;
      if ( options._iframe && options._iframe.contentWindow ) {
        options._sketchfabAPI.finish();
      }
      options._sketchfabAPI.stop();
      options._sketchfabAPI = null;
    }

    if ( options._container && options._iframe ) {
      options._container.removeChild( options._iframe );
      options._iframe = null;
    }

    if ( options.src ) {
      src = options.src.match( /sketchfab\.com\/show\/([A-Za-z0-9]{9,27})|^([A-Za-z0-9]{9,27})$/ );
      if ( src ) {
        src = src[ src.length - 1 ] || src[ src.length - 2 ];

        options._iframe = iframe = document.createElement( "iframe" );
        iframe.classList.add( "sketchfab-iframe" );

        var api = options._sketchfabAPI = new Sketchfab( iframe );

        var sketchfabOptions = {
          nocamera: 0,
          autostart: 1,
          autospin: ( options.autospin ? "1" : "0" ),
          transparent: ( options.background ? "0" : "1" ),
          controls: 0,
          watermark: 0,
          desc_button: 0,
          stop_button: 0
        };

        SketchfabQuery.when( api.load( src, sketchfabOptions ) ).then( function( data ) {
          if ( !api._preventStartFlag ) {
            api.start();
          }
        }).fail( function( error ) {
          console.error( "Sketchfab error: ", error );
        });

        iframe.setAttribute( "height", options.height );
        iframe.setAttribute( "width", options.width );
        iframe.setAttribute( "frameborder", 0 );
        iframe.setAttribute( "allowFullScreen", true );
        iframe.setAttribute( "webkitallowfullscreen", true );<commit_msg>Fix Bug 919727 - More permissive sketchfab regex<commit_after>(function ( Popcorn ) {

  var Sketchfab;
  var SketchfabQuery;

  function validateDimension( value, fallback ) {
    if ( typeof value === "number" ) {
      return value;
    }
    return fallback;
  }

  function setupIframe( options ) {
    var iframe, src, iframeOptions;

    if ( options._sketchfabAPI ) {
      options._sketchfabAPI._preventStartFlag = true;
      if ( options._iframe && options._iframe.contentWindow ) {
        options._sketchfabAPI.finish();
      }
      options._sketchfabAPI.stop();
      options._sketchfabAPI = null;
    }

    if ( options._container && options._iframe ) {
      options._container.removeChild( options._iframe );
      options._iframe = null;
    }

    if ( options.src ) {
      src = options.src.match( /(https?:\/\/sketchfab\.com\/show\/)?(\w+)/ );
      if ( src ) {
        src = src[ src.length - 1 ];

        options._iframe = iframe = document.createElement( "iframe" );
        iframe.classList.add( "sketchfab-iframe" );

        var api = options._sketchfabAPI = new Sketchfab( iframe );

        var sketchfabOptions = {
          nocamera: 0,
          autostart: 1,
          autospin: ( options.autospin ? "1" : "0" ),
          transparent: ( options.background ? "0" : "1" ),
          controls: 0,
          watermark: 0,
          desc_button: 0,
          stop_button: 0
        };

        SketchfabQuery.when( api.load( src, sketchfabOptions ) ).then( function( data ) {
          if ( !api._preventStartFlag ) {
            api.start();
          }
        }).fail( function( error ) {
          console.error( "Sketchfab error: ", error );
        });

        iframe.setAttribute( "height", options.height );
        iframe.setAttribute( "width", options.width );
        iframe.setAttribute( "frameborder", 0 );
        iframe.setAttribute( "allowFullScreen", true );
        iframe.setAttribute( "webkitallowfullscreen", true );
{'fraction_non_alphanumeric': 0.1336533602829712, 'fraction_numerical': 0.010358767054067712, 'mean_word_length': 2.187600644122383, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7248657', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1174, 'n_words': 249}