code: def assert_run_python_script(source_code):
      """Utility to check assertions in an independent Python subprocess.
  
      The script provided in the source code should return 0 and not print
      anything on stderr or stdout. Modified from scikit-learn test utils.
  
      Args:
          source_code (str): The Python source code to execute.
      """
      with get_tmp_dir() as root:
          path = pathlib.Path(root) / "main.py"
          with open(path, "w") as file:
              file.write(source_code)
  
          try:
              out = check_output(
                  [sys.executable, str(path)], stderr=STDOUT
              )
          except CalledProcessError as e:
              raise RuntimeError(
                  f"script errored with output:\n{e.output.decode()}"
              )
          if out != b"":
              raise AssertionError(out.decode())
  
imports: import contextlib
  import functools
  import itertools
  import os
  import pathlib
  import random
  import re
  import shutil
  import sys
  import tempfile
  import warnings
  from subprocess import CalledProcessError, check_output, STDOUT
  import numpy
  import PIL.Image
  import pytest
  import torch
  import torch.testing
  from PIL import Image
  from torch.testing._comparison import BooleanPair, NonePair, not_close_error_metas, NumberPair, TensorLikePair
  from torchvision import io, tv_tensors
  from torchvision.transforms._functional_tensor import _max_value
  from torchvision.transforms.v2.functional import to_image, to_pil_image
label_desc: Use image node_id 31 for calling a global function with example usage: assert_run_python_script(source_code) without return types