code: def create_script_fn(self, method_name, func_type):
      # function returns tuple containing original output and
      # filtered output to be used in checking gradients
      def script_fn(*args, **kwargs):
          fn, tensors = gen_script_fn_and_args(
              method_name, func_type, *args, **kwargs
          )
          self.assertExportImport(fn.graph, tensors)
          output = fn(*tensors)
          # skip type annotate function attributes for now, see: https://github.com/python/mypy/issues/2087
          script_fn.last_graph = fn.graph_for(*tensors)  # type: ignore[attr-defined]
          return output
  
      return script_fn
  
imports: from torch.jit.annotations import BroadcastingList2, BroadcastingList3
  import torch.nn.functional
  import torch
  import torch.cuda
  import torch.jit
  import torch.jit._logging
  import torch.jit.frontend
  from torch.testing._internal.common_nn import module_tests, new_module_tests
  from torch.testing._internal.common_utils import is_iterable_of_tensors, noncontiguous_like
  import collections
  from copy import deepcopy
  from typing import Any, Dict, List, Union
  import math
  from torch import inf
label_desc: Use image node_id 8 for calling a global function with example usage: create_script_fn(method_name, func_type) and returns: script_fn, output