code: def trapezoid(y, x=None, *, dx=None, dim=-1):
      if x is not None:
          y, x = torch_frontend.promote_types_of_torch_inputs(y, x)
      return ivy.trapz(y, x=x, dx=dx, axis=dim)
  
imports: import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  import ivy.functional.frontends.torch
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 25 for calling a global function with example usage: trapezoid(y, x) and returns: ivy