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

/**
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME>
 */
define( function( require ) {
  'use strict';

  // modules
  var assertInstanceOf = require( 'PHET_IO/assertions/assertInstanceOf' );
  var phetioInherit = require( 'PHET_IO/phetioInherit' );
  var phetioNamespace = require( 'PHET_IO/phetioNamespace' );
  var TObject = require( 'PHET_IO/types/TObject' );
  var phetioEvents = require( 'PHET_IO/phetioEvents' );

  // Emitter for 0, 1 or 2 args
  var TTandemEmitter = function( argTypes ) {
    assert && assert( argTypes, 'argTypes should be defined' );
    return phetioInherit( TObject, 'TTandemEmitter', function( tandemEmitter, phetioID ) {

      TObject.call( this, tandemEmitter, phetioID );
      assertInstanceOf( tandemEmitter, phet.tandem.TandemEmitter );

      var messageIndex = null;

      tandemEmitter.callbacksStartedEmitter.addListener( function() {
        assert && assert( arguments.length === argTypes.length, 'Wrong number of arguments, expected ' + argTypes.length + ', received ' + arguments.length );
        var p = [];
        for ( var i = 0; i < arguments.length; i++ ) {
          var a = arguments[ i ];
          p.push( a );
        }
        var parameters = { arguments: p };
        messageIndex = phetioEvents.start( 'model', phetioID, TTandemEmitter( argTypes ), 'emitted', parameters );
      } );

      tandemEmitter.callbacksEndedEmitter.addListener( function() {
        assert && assert( arguments.length === 0, 'Wrong number of arguments, expected ' + argTypes.length + ', received ' + arguments.length );
        messageIndex && phetioEvents.end( messageIndex );
      } );
    }, {}, {
      documentation: 'Emitters indicate when events have occurred, with optional arguments describing the event',
      events: [ 'emitted' ]
    } );
  };

  phetioNamespace.register( 'TTandemEmitter', TTandemEmitter );

  return TTandemEmitter;
} );
<commit_msg>renamed argTypes to phetioArgumentTypes, see https://github.com/phetsims/phet-io/issues/538<commit_after>// Copyright 2016, University of Colorado Boulder

/**
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME>
 */
define( function( require ) {
  'use strict';

  // modules
  var assertInstanceOf = require( 'PHET_IO/assertions/assertInstanceOf' );
  var phetioInherit = require( 'PHET_IO/phetioInherit' );
  var phetioNamespace = require( 'PHET_IO/phetioNamespace' );
  var TObject = require( 'PHET_IO/types/TObject' );
  var phetioEvents = require( 'PHET_IO/phetioEvents' );

  // Emitter for 0, 1 or 2 args
  var TTandemEmitter = function( phetioArgumentTypes ) {
    assert && assert( phetioArgumentTypes, 'phetioArgumentTypes should be defined' );
    return phetioInherit( TObject, 'TTandemEmitter', function( tandemEmitter, phetioID ) {

      TObject.call( this, tandemEmitter, phetioID );
      assertInstanceOf( tandemEmitter, phet.tandem.TandemEmitter );

      var messageIndex = null;

      tandemEmitter.callbacksStartedEmitter.addListener( function() {
        assert && assert( arguments.length === phetioArgumentTypes.length, 'Wrong number of arguments, expected ' + phetioArgumentTypes.length + ', received ' + arguments.length );
        var p = [];
        for ( var i = 0; i < arguments.length; i++ ) {
          var a = arguments[ i ];
          p.push( a );
        }
        var parameters = { arguments: p };
        messageIndex = phetioEvents.start( 'model', phetioID, TTandemEmitter( phetioArgumentTypes ), 'emitted', parameters );
      } );

      tandemEmitter.callbacksEndedEmitter.addListener( function() {
        assert && assert( arguments.length === 0, 'Wrong number of arguments, expected ' + phetioArgumentTypes.length + ', received ' + arguments.length );
        messageIndex && phetioEvents.end( messageIndex );
      } );
    }, {}, {
      documentation: 'Emitters indicate when events have occurred, with optional arguments describing the event',
      events: [ 'emitted' ]
    } );
  };

  phetioNamespace.register( 'TTandemEmitter', TTandemEmitter );

  return TTandemEmitter;
} );

{'fraction_non_alphanumeric': 0.1220159151193634, 'fraction_numerical': 0.0050639016156257535, 'mean_word_length': 3.4316239316239314, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '960309', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1254, 'n_words': 311}