code: def test_pep585_type(self):
      # TODO add test to use PEP585 type annotation for return type after py3.9
      # see: https://www.python.org/dev/peps/pep-0585/#id5
      def fn(
          x: torch.Tensor,
      ) -> Tuple[Tuple[torch.Tensor], Dict[str, int]]:
          xl: list[tuple[torch.Tensor]] = []
          xd: dict[str, int] = {}
          xl.append((x,))
          xd["foo"] = 1
          return xl.pop(), xd
  
      self.checkScript(fn, [torch.randn(2, 2)])
  
      x = torch.randn(2, 2)
      expected = fn(x)
      scripted = torch.jit.script(fn)(x)
  
      self.assertEqual(expected, scripted)
  
imports: from collections import namedtuple
  from typing import Dict, Iterator, List, Optional, Tuple
  from torch.testing._internal.jit_utils import JitTestCase
  from torch.testing import FileCheck
  from textwrap import dedent
  from jit.test_module_interface import TestModuleInterface
  import inspect
  import os
  import sys
  import torch
  import torch.testing._internal.jit_utils
label_desc: Use image node_id 1 for calling the TestTypesAndAnnotation obj's underlying member method code with example usage: obj.test_pep585_type() and returns: xl,  xd