code: def _eigvals_tranform(
      tape: qml.tape.QuantumTape, k=1, which="SA"
  ) -> (Sequence[qml.tape.QuantumTape], Callable):
      def processing_fn(res):
          op_wires = [op.wires for op in res[0].operations]
          all_wires = qml.wires.Wires.all_wires(op_wires).tolist()
          unique_wires = qml.wires.Wires.unique_wires(op_wires).tolist()
  
          if len(all_wires) != len(unique_wires):
              warnings.warn(
                  "For multiple operations, the eigenvalues will be computed numerically. "
                  "This may be computationally intensive for a large number of wires.",
                  UserWarning,
              )
              matrix = qml.matrix(res[0])
              return qml.math.linalg.eigvals(matrix)
  
          # TODO: take into account wire ordering, by reordering eigenvalues
          # as per operator wires/wire ordering, and by inserting implicit identity
          # matrices (eigenvalues [1, 1]) at missing locations.
  
          ev = [
              eigvals(op, k=k, which=which) for op in res[0].operations
          ]
  
          if len(ev) == 1:
              return ev[0]
  
          return reduce(qml.math.kron, ev)
  
      return [tape], processing_fn
  
file_path: pennylane/pennylane/ops/functions/eigvals.py
imports: from typing import Sequence, Callable
  import warnings
  from functools import reduce, partial
  import scipy
  import pennylane
  from pennylane.transforms.op_transforms import OperationTransformError
  from pennylane import transform
  from pennylane.typing import TensorLike
label_desc: Use image node_id 2 for calling a global function with example usage: _eigvals_tranform(tape, k, which) and returns: list,  processing_fn, reduce, qml, ev