code: def test_beta_inc_stan_grad_combined(self):
      # This test replicates the following STAN test:
      # https://github.com/stan-dev/math/blob/master/test/unit/math/prim/fun/grad_reg_inc_beta_test.cpp
      a, b, z = pt.scalars("a", "b", "z")
      betainc_out = pt.betainc(a, b, z)
      betainc_grad = pt.grad(betainc_out, [a, b])
      f_grad = function([a, b, z], betainc_grad)
  
      for test_a, test_b, test_z, expected_dda, expected_ddb in (
          (1.0, 1.0, 1.0, 0, np.nan),
          (1.0, 1.0, 0.4, -0.36651629, 0.30649537),
      ):
          np.testing.assert_allclose(
              f_grad(test_a, test_b, test_z),
              [expected_dda, expected_ddb],
          )
  
imports: import warnings
  import numpy
  import pytest
  from pytensor.gradient import verify_grad
  from pytensor.scalar import ScalarLoop
  from pytensor.tensor.elemwise import Elemwise
  from functools import partial
  import scipy.special
  import scipy.stats
  from pytensor import function, grad
  from pytensor import tensor
  from pytensor.compile.mode import get_default_mode
  from pytensor.configdefaults import config
  from pytensor.tensor import gammaincc, inplace, vector
  from tests import unittest_tools
  from tests.tensor.utils import _good_broadcast_unary_chi2sf, _good_broadcast_unary_normal, _good_broadcast_unary_normal_float, _good_broadcast_unary_normal_float_no_complex, _good_broadcast_unary_normal_float_no_complex_small_neg_range, _good_broadcast_unary_normal_no_complex, _grad_broadcast_unary_0_2_no_complex, _grad_broadcast_unary_abs1_no_complex, _grad_broadcast_unary_normal, _grad_broadcast_unary_normal_small_neg_range, check_floatX, copymod, integers_ranged, makeBroadcastTester, random_ranged, upcast_int8_nfunc
label_desc: Use image node_id 3 for calling the TestBetaIncGrad obj's underlying member method code with example usage: obj.test_beta_inc_stan_grad_combined() without return types