code: def _expand_metric_tensor(
      tape: qml.tape.QuantumTape,
      argnum=None,
      approx=None,
      allow_nonunitary=True,
      aux_wire=None,
      device_wires=None,
  ) -> (
      Sequence[qml.tape.QuantumTape],
      Callable,
  ):  # pylint: disable=too-many-arguments
      """Set the metric tensor based on whether non-unitary gates are allowed."""
      # pylint: disable=unused-argument,too-many-arguments
  
      if not allow_nonunitary and approx is None:
          return [
              qml.transforms.expand_nonunitary_gen(tape)
          ], lambda x: x[0]
      return [qml.transforms.expand_multipar(tape)], lambda x: x[0]
  
file_path: pennylane/pennylane/gradients/metric_tensor.py
imports: from typing import Sequence, Callable
  import functools
  from functools import partial
  import warnings
  import numpy
  import pennylane
  from pennylane.circuit_graph import LayerData
  from pennylane.queuing import WrappedObj
  from pennylane.transforms import transform
label_desc: Use image node_id 2 for calling a global function with example usage: _expand_metric_tensor(tape, argnum, approx, allow_nonunitary, aux_wire, device_wires) and returns: list,  function, list,  function