code: def test_expansion_strategy(device):
      """Test expansion strategy keyword modifies tape expansion."""
  
      H = (
          qml.PauliX(0)
          + qml.PauliZ(1)
          + 0.5 * qml.PauliX(0) @ qml.PauliX(1)
      )
  
      @qml.qnode(device)
      def circ(t):
          qml.ApproxTimeEvolution(H, t, 2)
          return qml.probs(wires=0)
  
      expected_gradient = "0: ─╭ApproxTimeEvolution─┤  Probs\n1: ─╰ApproxTimeEvolution─┤       "
      assert (
          draw(circ, expansion_strategy="gradient", decimals=None)(0.5)
          == expected_gradient
      )
  
      expected_device = "0: ──RX─╭RXX──RX─╭RXX─┤  Probs\n1: ──RZ─╰RXX──RZ─╰RXX─┤       "
      assert (
          draw(circ, expansion_strategy="device", decimals=None)(0.5)
          == expected_device
      )
  
imports: from functools import partial
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.drawer import draw
label_desc: Use image node_id 4 for calling a global function with example usage: test_expansion_strategy(device) and returns: qml