code: def _add_adjoint_transforms(program: TransformProgram) -> None:
      """Private helper function for ``preprocess`` that adds the transforms specific
      for adjoint differentiation.
  
      Args:
          program (TransformProgram): where we will add the adjoint differentiation transforms
  
      Side Effects:
          Adds transforms to the input program.
  
      """
  
      def adjoint_ops(op: qml.operation.Operator) -> bool:
          """Specify whether or not an Operator is supported by adjoint differentiation."""
          return (
              op.num_params == 0
              or op.num_params == 1
              and op.has_generator
          )
  
      def adjoint_observables(obs: qml.operation.Operator) -> bool:
          """Specifies whether or not an observable is compatible with adjoint differentiation on DefaultQubit."""
          return obs.has_matrix
  
      name = "adjoint + default.qubit"
      program.add_transform(no_sampling, name=name)
      program.add_transform(
          decompose,
          stopping_condition=adjoint_ops,
          name=name,
      )
      program.add_transform(
          validate_observables, adjoint_observables, name=name
      )
      program.add_transform(
          validate_measurements,
          name=name,
      )
      program.add_transform(adjoint_state_measurements)
      program.add_transform(qml.transforms.broadcast_expand)
      program.add_transform(validate_adjoint_trainable_params)
  
imports: from dataclasses import replace
  from functools import partial
  from numbers import Number
  from typing import Union, Callable, Tuple, Optional, Sequence
  import concurrent.futures
  import inspect
  import logging
  import numpy
  import pennylane
  from pennylane.tape import QuantumTape, QuantumScript
  from pennylane.typing import Result, ResultBatch
  from pennylane.transforms import convert_to_numpy_parameters
  from pennylane.transforms.core import TransformProgram
  from .None import Device
  from .preprocess import decompose, validate_observables, validate_measurements, validate_multiprocessing_workers, validate_device_wires, validate_adjoint_trainable_params, no_sampling
  from .execution_config import ExecutionConfig, DefaultExecutionConfig
  from .qubit.simulate import simulate, get_final_state, measure_final_state
  from .qubit.sampling import get_num_shots_and_executions
  from .qubit.adjoint_jacobian import adjoint_jacobian, adjoint_vjp, adjoint_jvp
label_desc: Use image node_id 7 for calling a global function with example usage: _add_adjoint_transforms(program) and returns: unknown, obs