code: def _diagonal(x, dim1, dim2):
      return x.diagonal(dim1=dim1, dim2=dim2)
  
imports: import numbers
  import typing
  import torch
  import funsor.ops
label_desc: Use image node_id 19 for calling a global function with example usage: _diagonal(x, dim1, dim2) and returns: x