code: def find_next_gate(wires, op_list):
      """Given a list of operations, finds the next operation that acts on at least one of
      the same set of wires, if present.
  
      Args:
          wires (Wires): A set of wires acted on by a quantum operation.
          op_list (list[Operation]): A list of operations that are implemented after the
              operation that acts on ``wires``.
  
      Returns:
          int or None: The index, in ``op_list``, of the earliest gate that uses one or more
          of the same wires, or ``None`` if no such gate is present.
      """
      next_gate_idx = None
  
      for op_idx, op in enumerate(op_list):
          if len(Wires.shared_wires([wires, op.wires])) > 0:
              next_gate_idx = op_idx
              break
  
      return next_gate_idx
  
file_path: pennylane/pennylane/transforms/optimization/optimization_utils.py
imports: from functools import partial
  import numpy
  from pennylane.math import abs
  from pennylane.math import sum
  from pennylane.math import allclose, arccos, arctan2, cos, get_interface, is_abstract, sin, stack
  from pennylane.wires import Wires
  from pennylane.ops.identity import GlobalPhase
label_desc: Use image node_id 1 for calling a global function with example usage: find_next_gate(wires, op_list) and returns: next_gate_idx