code: def get_normalized_nth_input(
      node: Node, gm: GraphModule, idx: int
  ) -> Node:
      """
      Given a node, gets the n'th input to that node, normalizing
      args and kwargs to the best of its ability.
      """
      try:
          norm_args_and_kwargs = node.normalized_arguments(
              gm, normalize_to_only_use_kwargs=True
          )
          if norm_args_and_kwargs is not None:
              norm_args, norm_kwargs = norm_args_and_kwargs
              assert len(norm_args) + len(norm_kwargs) > idx
              if idx < len(norm_args):
                  return norm_args[idx]
              else:
                  # note: in Python 3.7+ dicts are ordered
                  return list(norm_kwargs.values())[idx]
          else:
              assert len(node.args) + len(node.kwargs) > idx
              if idx < len(node.args):
                  return node.args[idx]  # type: ignore[return-value]
              else:
                  kwargs_idx = idx + len(node.args)
                  return list(node.kwargs.values())[kwargs_idx]  # type: ignore[return-value]
      except RuntimeError:
          # this RuntimeError happens when node argument normalization
          # requires typehints to proceed, such as for torch.add where
          # either the first, second or both arguments could be tensors
          assert len(node.args) + len(node.kwargs) > idx
          if idx < len(node.args):
              return node.args[idx]  # type: ignore[return-value]
          else:
              kwargs_idx = idx + len(node.args)
              return list(node.kwargs.values())[kwargs_idx]
  
imports: import enum
  import operator
  import torch
  import torch.nn
  import torch.ao.nn.intrinsic.quantized
  import torch.ao.nn.quantized
  from typing import Tuple, Callable, Dict, Set, List, Optional, Union
  from torch.fx import GraphModule
  from torch.fx.graph import Node
  from torch.ao.quantization import ObserverBase, FakeQuantizeBase
  from torch.ao.quantization.utils import getattr_from_fqn
  from torch.ao.quantization.observer import _is_activation_post_process
  from .ns_types import NSNodeTargetType, NSResultsType
label_desc: Use image node_id 14 for calling a global function with example usage: get_normalized_nth_input(node, gm, idx) and returns: norm_args, list, node, list, node, list