function networkRecordsToDevtoolsLog(networkRecords, options = {}) {
  const devtoolsLog = [];
  networkRecords.forEach((networkRecord, index) => {
    if (networkRecord.url && new URL(networkRecord.url).hash) {
      throw new Error(`Network records should not have hashes: ${networkRecord.url}`);
    }

    networkRecord = addRedirectResponseIfNeeded(networkRecords, networkRecord);

    const normalizedTiming = getNormalizedRequestTiming(networkRecord);
    devtoolsLog.push(getRequestWillBeSentEvent(networkRecord, index, normalizedTiming));

    if (willBeRedirected(networkRecords, networkRecord)) {
      // If record is going to redirect, only issue the first event.
      return;
    }

    if (networkRecord.fromMemoryCache) {
      devtoolsLog.push(getRequestServedFromCacheEvent(networkRecord, index));
    }

    if (networkRecord.failed) {
      devtoolsLog.push(getLoadingFailedEvent(networkRecord, index, normalizedTiming));
      return;
    }

    devtoolsLog.push(getResponseReceivedEvent(networkRecord, index, normalizedTiming));
    if (networkRecord.responseHeadersText) {
      devtoolsLog.push(getResponseReceivedExtraInfoEvent(networkRecord, index));
    }
    devtoolsLog.push(getDataReceivedEvent(networkRecord, index));

    if (networkRecord.finished !== false) {
      devtoolsLog.push(getLoadingFinishedEvent(networkRecord, index, normalizedTiming));
    }
  });

  // If in a test, assert that the log will turn into an equivalent networkRecords.
  if (global.expect && !options.skipVerification) {
    const roundTrippedNetworkRecords = NetworkRecorder.recordsFromLogs(devtoolsLog);
    expect(roundTrippedNetworkRecords).toMatchObject(networkRecords);
  }

  return devtoolsLog;
}
Generate a devtoolsLog that can regenerate the passed-in `networkRecords`.
Generally best at replicating artificial or pruned networkRecords used for
testing. If run from a test runner, verifies that everything in
`networkRecords` will be in any network records generated from the output
(use `skipVerification` to manually skip this assertion).
@param {Array<Partial<NetworkRequest>>} networkRecords
@param {{skipVerification?: boolean}=} options
@return {LH.DevtoolsLog}