code: def test_second_constant_scalar():
      b = scalar("b", dtype="int")
      out = pt.second(0.0, b)
      fgraph = FunctionGraph([b], [out])
      # Test dispatch directly as useless second is removed during compilation
      fn = jax_funcify(fgraph)
      [res] = fn(1)
      assert res == 1
      assert res.dtype == out.dtype
  
imports: import numpy
  import pytest
  import pytensor.scalar.basic
  import pytensor.tensor
  from pytensor.configdefaults import config
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.op import get_test_value
  from pytensor.scalar.basic import Composite
  from pytensor.tensor import as_tensor
  from pytensor.tensor.elemwise import Elemwise
  from pytensor.tensor.math import all
  from pytensor.tensor.math import betaincinv, cosh, erf, erfc, erfcinv, erfcx, erfinv, gammainccinv, gammaincinv, iv, log, log1mexp, polygamma, psi, sigmoid, softplus, tri_gamma
  from pytensor.tensor.type import matrix, scalar, vector
  from tests.link.jax.test_basic import compare_jax_and_py
  from pytensor.link.jax.dispatch import jax_funcify
label_desc: Use image node_id 2 for calling a global function with example usage: test_second_constant_scalar() without return types