<commit_before>// Copyright 2018, University of Colorado Boulder

/**
 * Tracks object allocations for reporting using binder.
 *
 * @author <NAME> (PhET Interactive Simulations)
 */
define( function( require ) {
  'use strict';

  // modules
  var phetCore = require( 'PHET_CORE/phetCore' );
  var inherit = require( 'PHET_CORE/inherit' );

  // constants
  var map = {};

  /**
   * @constructor
   */
  function InstanceRegistry() {
  }

  phetCore.register( 'InstanceRegistry', InstanceRegistry );

  return inherit( Object, InstanceRegistry, {}, {

    /**
     * @public (read-only) - used by puppeteer in binder
     */
    map: map,

    /**
     * Adds a screenshot of the given scenery Node
     * @param {string} typeName
     * @param {Node} instance
     * @public
     */
    registerDataURL: function( typeName, instance ) {
      if ( phet.chipper.queryParameters.binder ) {

        // Create the map if we haven't seen that component type before
        map[ typeName ] = map[ typeName ] || [];

        try {
          instance.toDataURL( function( dataURL ) {
            map[ typeName ].push( dataURL );
          } );
        }
        catch( e ) {

          // Ignore nodes that don't draw anything
          // TODO: is this masking a problem?
        }
      }
    }
  } );
} );<commit_msg>Specify repo, and include images, see https://github.com/phetsims/binder/issues/1<commit_after>// Copyright 2018, University of Colorado Boulder

/**
 * Tracks object allocations for reporting using binder.
 *
 * @author <NAME> (PhET Interactive Simulations)
 */
define( function( require ) {
  'use strict';

  // modules
  var phetCore = require( 'PHET_CORE/phetCore' );
  var inherit = require( 'PHET_CORE/inherit' );

  // constants
  var map = {};

  /**
   * @constructor
   */
  function InstanceRegistry() {
  }

  phetCore.register( 'InstanceRegistry', InstanceRegistry );

  return inherit( Object, InstanceRegistry, {}, {

    /**
     * @public (read-only) - used by puppeteer in binder
     */
    map: map,

    /**
     * Adds a screenshot of the given scenery Node
     * @param {string} repoName
     * @param {string} typeName
     * @param {Node} instance
     * @public
     */
    registerDataURL: function( repoName, typeName, instance ) {
      if ( phet.chipper.queryParameters.binder ) {

        // Create the map if we haven't seen that component type before
        var key = repoName + '/' + typeName;
        map[ key ] = map[ key ] || [];

        try {
          instance.toDataURL( function( dataURL ) {
            map[ key ].push( dataURL );
          } );
        }
        catch( e ) {

          // Ignore nodes that don't draw anything
          // TODO: is this masking a problem?
        }
      }
    }
  } );
} );
{'fraction_non_alphanumeric': 0.12481962481962482, 'fraction_numerical': 0.003246753246753247, 'mean_word_length': 2.169142857142857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '3814318', 'n_tokens_mistral': 858, 'n_tokens_neox': 814, 'n_words': 240}