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

const axios = require( 'axios' );
const puppeteer = require( 'puppeteer' );

/**
 *
 * @param {string} simName
 * @param {object} page - a puppeteer object
 * @param {string[]} locales - a list of locale codes
 * @returns {Promise<{}>}
 */
const parseScreenNamesFromSimulation = async ( simName, page, locales ) => {
  const returnObject = {};

  for ( let localeIndex = 0; localeIndex < locales.length; localeIndex++ ) {
    const locale = locales[ localeIndex ];

    const s = `https://phet.colorado.edu/sims/html/${simName}/latest/${simName}_all.html?locale=${locale}`;
    await page.goto( s );
    await page.waitForFunction( 'phet' );
    await page.waitForFunction( 'phet.joist' );
    await page.waitForFunction( 'phet.joist.sim' );
    await page.waitForFunction( 'phet.joist.sim.screens' );
    returnObject[ locale ] = await page.evaluate( () => {
      return phet.joist.sim.screens
        .map( screen => screen.name || ( screen.nameProperty && screen.nameProperty.value ) )
        .filter( ( screenName, screenIndex ) => !( screenIndex === 0 && screenName === '\u202aHome\u202c' ) );
    } );
  }

  return returnObject;<commit_msg>move jsdoc dot for parameter types to bad-text, update regex and fix errors, https://github.com/phetsims/chipper/issues/1003<commit_after>// Copyright 2021, University of Colorado Boulder

const axios = require( 'axios' );
const puppeteer = require( 'puppeteer' );

/**
 *
 * @param {string} simName
 * @param {object} page - a puppeteer object
 * @param {string[]} locales - a list of locale codes
 * @returns {Promise.<{}>}
 */
const parseScreenNamesFromSimulation = async ( simName, page, locales ) => {
  const returnObject = {};

  for ( let localeIndex = 0; localeIndex < locales.length; localeIndex++ ) {
    const locale = locales[ localeIndex ];

    const s = `https://phet.colorado.edu/sims/html/${simName}/latest/${simName}_all.html?locale=${locale}`;
    await page.goto( s );
    await page.waitForFunction( 'phet' );
    await page.waitForFunction( 'phet.joist' );
    await page.waitForFunction( 'phet.joist.sim' );
    await page.waitForFunction( 'phet.joist.sim.screens' );
    returnObject[ locale ] = await page.evaluate( () => {
      return phet.joist.sim.screens
        .map( screen => screen.name || ( screen.nameProperty && screen.nameProperty.value ) )
        .filter( ( screenName, screenIndex ) => !( screenIndex === 0 && screenName === '\u202aHome\u202c' ) );
    } );
  }

  return returnObject;
{'fraction_non_alphanumeric': 0.15499606608969316, 'fraction_numerical': 0.011014948859166011, 'mean_word_length': 3.6320582877959926, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 3, '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': '4805209', 'n_tokens_mistral': 834, 'n_tokens_neox': 817, 'n_words': 194}