code: def check_stdout(actual_stdout: str, expected_stdout_path: str):
      """
      Check that actual and expected stdouts match.
  
      Given a string of the actual stdout and a path to the expected stdout, check that
      both stdouts match, keeping in mind that the actual stdout may have additional
      strings relating to progress updates that are not found in the expected output
      strings.
  
      TODO: this can probably be moved to a method of an abstract test class once all
       analysis code relies on pytest regressions for some of its tests.
      """
      actual_stdout_lines = actual_stdout.split("\n")
      with open(expected_stdout_path) as f:
          expected_stdout = f.read()
      for expected_line in expected_stdout.split("\n"):
          if not any(
              collapse_whitespace(expected_line)
              in collapse_whitespace(actual_line)
              for actual_line in actual_stdout_lines
          ):
              raise ValueError(
                  f"\n\tThe following line:\n\n{expected_line}\n\n\twas not found "
                  f"in the actual stdout:\n\n{actual_stdout}"
              )
  
imports: import os
  import random
  import tempfile
  import time
  import unittest
  from typing import Any, Dict, List, Optional, Sequence, Union
  import numpy
  import torch
  from parlai.utils import logging
  from hydra.experimental import compose, initialize
  from mephisto.abstractions.blueprint import SharedTaskState
  from mephisto.abstractions.databases.local_database import LocalMephistoDB
  from mephisto.data_model.task_run import TaskRunArgs
  from mephisto.operations.operator import Operator
  from mephisto.tools.scripts import augment_config_from_db
  from mephisto.utils.metrics import InaccessiblePrometheusServer
  from pytest_regressions.data_regression import DataRegressionFixture
label_desc: Use image node_id 2 for calling a global function with example usage: check_stdout(actual_stdout, expected_stdout_path) without return types