code: def _group_measurements(
      measurements: List[MeasurementProcess],
  ) -> List[List[MeasurementProcess]]:
      """Group observables of ``measurements`` into groups with non overlapping wires.
  
      Args:
          measurements (List[MeasurementProcess]): list of measurement processes
  
      Returns:
          List[List[MeasurementProcess]]: list of groups of observables with non overlapping wires
      """
      qwc_groups = []
      for m in measurements:
          if (
              len(m.wires) == 0
          ):  # measurement acts on all wires: e.g. qml.counts()
              qwc_groups.append((m.wires, [m]))
              continue
  
          op_added = False
          for idx, (wires, group) in enumerate(qwc_groups):
              if len(wires) > 0 and all(
                  wire not in m.wires for wire in wires
              ):
                  qwc_groups[idx] = (wires + m.wires, group + [m])
                  op_added = True
                  break
  
          if not op_added:
              qwc_groups.append((m.wires, [m]))
  
      return [group[1] for group in qwc_groups]
  
file_path: pennylane/pennylane/transforms/hamiltonian_expand.py
imports: from typing import List, Sequence, Callable
  import pennylane
  from pennylane.measurements import ExpectationMP, MeasurementProcess
  from pennylane.ops import SProd, Sum
  from pennylane.tape import QuantumScript, QuantumTape
  from pennylane.transforms import transform
label_desc: Use image node_id 3 for calling a global function with example usage: _group_measurements(measurements) and returns: unknown