code: def make_stub_from_method(nn_module, method_name):
      func = getattr(nn_module, method_name)
      if isinstance(func, ScriptMethodStub):
          return func
      # Make sure the name present in the resulting AST will match the name
      # requested here. The only time they don't match is if you do something
      # like:
      #   def _forward(self):
      #       pass
      #   forward = _forward
      # In this case, the actual function object will have the name `_forward`,
      # even though we requested a stub for `forward`.
      return make_stub(func, method_name)
  
imports: import collections
  import functools
  import inspect
  import sys
  import textwrap
  import types
  import warnings
  from typing import Dict, List, Set, Type
  import torch
  import torch._jit_internal
  from torch._sources import fake_range
  from torch.jit._builtins import _find_builtin
  from torch.jit._check import AttributeTypeIsSupportedChecker
  from torch.jit._state import _add_script_class, _get_script_class, _python_cu
  from torch.jit.frontend import get_class_properties, get_default_args, get_jit_class_def, get_jit_def
  from torch.nn import Module
label_desc: Use image node_id 3 for calling a global function with example usage: make_stub_from_method(nn_module, method_name) and returns: make_stub, func