code: def test_stanc_unused_warning() -> None:
      """Test that stanc warning is shown to user."""
      program_code = """
      parameters {
      real y;
      }
      model {
      real x;
      x = 5;
      }
      """
      buffer = io.StringIO()
      with contextlib.redirect_stderr(buffer):
          stan.build(program_code=program_code)
      assert (
          "The parameter y was declared but was not used in the density"
          in buffer.getvalue()
      )
  
imports: import contextlib
  import io
  import stan
label_desc: Use image node_id 2 for calling a global function with example usage: test_stanc_unused_warning() without return types