code: def test_failed_function_compilation(self):
      def fn(x):
          return i_dont_exist  # noqa: F821
  
      class M(torch.nn.Module):
          def __init__(self, fn):
              super().__init__()
              self.fn = fn
  
          def forward(self, x):
              return self.fn(x)
  
      m = M(fn)
      with self.assertRaisesRegexWithHighlight(
          RuntimeError, "failed to compile", "i_dont_exist"
      ):
          torch.jit.script(m)
  
imports: import os
  import re
  import sys
  import types
  import typing
  import typing_extensions
  from typing import List, Dict, Optional, Tuple
  import torch
  import torch.jit.frontend
  import torch.nn
  from torch import Tensor
  from torch.testing import FileCheck
  from collections import OrderedDict
  from torch.testing._internal.jit_utils import JitTestCase, _tmp_donotuse_dont_inline_everything
label_desc: Use image node_id 4 for calling the TestRecursiveScript obj's underlying member method code with example usage: obj.test_failed_function_compilation() and returns: i_dont_exist, self