code: def verify_grad(op, pt, n_tests=2, rng=None, *args, **kwargs):
      """
      Wrapper for gradient.py:verify_grad
      Takes care of seeding the random number generator if None is given
      """
      if rng is None:
          rng = np.random.default_rng(fetch_seed())
  
      # TODO: Needed to increase tolerance for certain tests when migrating to
      # Generators from RandomStates. Caused flaky test failures. Needs further investigation
      if "rel_tol" not in kwargs:
          kwargs["rel_tol"] = 0.05
      if "abs_tol" not in kwargs:
          kwargs["abs_tol"] = 0.05
      orig_verify_grad(op, pt, n_tests, rng, *args, **kwargs)
  
imports: import logging
  import sys
  from copy import copy, deepcopy
  from functools import wraps
  import numpy
  import pytest
  import pytensor
  from pytensor.compile.debugmode import str_diagnostic
  from pytensor.configdefaults import config
  from pytensor.gradient import verify_grad
  from pytensor.tensor.basic import as_tensor_variable
  from pytensor.tensor.math import _allclose
  from pytensor.tensor.math import add
label_desc: Use image node_id 2 for calling a global function with example usage: verify_grad(op, pt, n_tests, rng) without return types