code: def gen_annotated_args(f: NativeFunction) -> str:
      def _get_kwargs_func_exclusion_list() -> List[str]:
          # functions that currently don't work with kwargs in test_overrides.py
          return [
              "diagonal",
              "round_",
              "round",
              "scatter_",
          ]
  
      def _add_out_arg(
          out_args: List[Dict[str, Any]],
          args: Sequence[Argument],
          *,
          is_kwarg_only: bool,
      ) -> None:
          for arg in args:
              if arg.default is not None:
                  continue
              out_arg: Dict[str, Any] = {}
              out_arg["is_kwarg_only"] = str(is_kwarg_only)
              out_arg["name"] = arg.name
              out_arg["simple_type"] = python.argument_type_str(
                  arg.type, simple_type=True
              )
              size_t = python.argument_type_size(arg.type)
              if size_t:
                  out_arg["size"] = size_t
              out_args.append(out_arg)
  
      out_args: List[Dict[str, Any]] = []
      _add_out_arg(
          out_args,
          f.func.arguments.flat_positional,
          is_kwarg_only=False,
      )
      if f"{f.func.name.name}" not in _get_kwargs_func_exclusion_list():
          _add_out_arg(
              out_args,
              f.func.arguments.flat_kwarg_only,
              is_kwarg_only=True,
          )
  
      return f"{f.func.name.name}: {repr(out_args)},"
  
file_path: pytorch/tools/autograd/gen_annotated_fn_args.py
imports: import argparse
  import os
  import textwrap
  from collections import defaultdict
  from typing import Any, Dict, List, Sequence
  import torchgen.api.python
  from torchgen.context import with_native_function
  from torchgen.gen import parse_native_yaml
  from torchgen.model import Argument, BaseOperatorName, NativeFunction
  from torchgen.utils import FileManager
  from .gen_python_functions import is_py_fft_function, is_py_linalg_function, is_py_nn_function, is_py_special_function, is_py_torch_function, is_py_variable_method, should_generate_py_binding
label_desc: Use image node_id 2 for calling a global function with example usage: gen_annotated_args(f) and returns: f, str, repr, str, list