class_docstr: Create a temporary python source code file.
class_docstr_tok: ["Create","a","temporary","python","source","code","file","."]
code: def __enter__(self):
      with tempfile.NamedTemporaryFile(
          mode="w", dir=self.dir, suffix=".py", delete=False
      ) as f:
          f.write(self.source_code)
      self.file_path = f.name
      return self.file_path
  
imports: from unittest import TestCase, mock
  import errno
  import os
  import tabnanny
  import tokenize
  import tempfile
  import textwrap
  from test.support import captured_stderr, captured_stdout, script_helper, findfile
  from test.support.os_helper import unlink
label_desc: Use image node_id 2 for calling the TemporaryPyFile obj's underlying member method code with example usage: obj.__enter__() and returns: self