code: def make_script(self, filename, dirname=None, text=None):
      if text:
          text = dedent(text)
      if dirname is None:
          dirname = self.temp_dir()
      filename = os.path.join(dirname, filename)
  
      os.makedirs(os.path.dirname(filename), exist_ok=True)
      with open(filename, "w", encoding="utf-8") as outfile:
          outfile.write(text or "")
      return filename
  
imports: import contextlib
  import os
  import os.path
  import subprocess
  import sys
  import tempfile
  import threading
  from textwrap import dedent
  import unittest
  from test import support
  from test.support import os_helper
  from test.support import interpreters
label_desc: Use image node_id 3 for calling the TestBase obj's underlying member method code with example usage: obj.make_script(filename, dirname, text) and returns: filename