code: def python_frame(frame: traceback.FrameSummary) -> _infra.StackFrame:
      """Returns a StackFrame for the given traceback.FrameSummary."""
      snippet = frame.line
  
      return _infra.StackFrame(
          location=_infra.Location(
              uri=frame.filename,
              line=frame.lineno,
              snippet=snippet,
              function=frame.name,
              message=snippet,
          )
      )
  
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 1 for calling a global function with example usage: python_frame(frame) and returns: _infra