code: def function_state(
      fn: Callable, args: Tuple[Any, ...], kwargs: Dict[str, Any]
  ) -> Mapping[str, Any]:
      bind = inspect.signature(fn).bind(*args, **kwargs)
      return bind.arguments
  
file_path: pytorch/torch/onnx/_internal/diagnostics/infra/utils.py
imports: from __future__ import annotations
  import functools
  import inspect
  import traceback
  from typing import Any, Callable, Dict, Mapping, Optional, Sequence, Tuple
  from torch.onnx._internal import _beartype
  from torch.onnx._internal.diagnostics.infra import _infra, formatter
label_desc: Use image node_id 5 for calling a global function with example usage: function_state(fn, args, kwargs) and returns: bind