code: def test_script_modulelist_index(self):
      class Sub(torch.nn.Module):
          def __init__(self, i):
              super().__init__()
              self.i = i
  
          def forward(self, thing):
              return thing - self.i
  
      class M(torch.nn.Module):
          def __init__(self):
              super().__init__()
              self.mods = nn.ModuleList([Sub(i) for i in range(10)])
  
          def forward(self, v):
              v = self.mods[4].forward(v)
              v = self.mods[-1].forward(v)
              v = self.mods[-9].forward(v)
              return v
  
      x = torch.tensor(1)
      self.checkModule(M(), (x,))
  
      class MForward(torch.nn.Module):
          def __init__(self):
              super().__init__()
              self.mods = nn.ModuleList([Sub(i) for i in range(10)])
  
          def forward(self, v):
              v = self.mods[4](v)
              v = self.mods[-1](v)
              v = self.mods[-9](v)
              return v
  
      self.checkModule(MForward(), (torch.tensor(1),))
  
      class M2(M):
          def forward(self, v):
              return self.mods[-11].forward(v)
  
      with self.assertRaisesRegexWithHighlight(
          Exception, "Index -11 out of range", "self.mods[-11]"
      ):
          torch.jit.script(M2())
  
      class M3(M):
          def forward(self, v):
              i = 3
              return self.mods[i].forward(v)
  
      with self.assertRaisesRegexWithHighlight(
          Exception, "Enumeration is supported", "self.mods[i]"
      ):
          torch.jit.script(M3())
  
      class M4(M):
          def forward(self, v):
              i = 3
              return self.mods[i].forward(v)
  
      with self.assertRaisesRegex(
          Exception, "will fail because i is not a literal"
      ):
          torch.jit.script(M4())
  
imports: import os
  import sys
  from typing import Any, List, Tuple
  from collections import OrderedDict
  import torch
  import torch.nn
  from torch.testing._internal.jit_utils import JitTestCase
label_desc: Use image node_id 5 for calling the TestModuleContainers obj's underlying member method code with example usage: obj.test_script_modulelist_index() and returns: unknown, v, v, self, self, self