code: def check_script_output(self, src, expected):
      with captured_stdout() as stdout:
          exec(src)
      out = stdout.getvalue().encode("latin1")
      self.assertEqual(out.rstrip(), expected)
  
imports: import unittest
  from test.support import script_helper, captured_stdout, requires_subprocess, requires_resource
  from test.support.os_helper import TESTFN, unlink, rmtree
  from test.support.import_helper import unload
  import importlib
  import os
  import sys
  import subprocess
  import tempfile
label_desc: Use image node_id 1 for calling the BytesSourceEncodingTest obj's underlying member method code with example usage: obj.check_script_output(src, expected) without return types