code: def test_build_grid_limit_size(caplog):
      """Test that grid search reduces the n_values when grid is too large"""
      dim1 = Real("dim1", "uniform", 0, 1)
      dim2 = Integer("dim2", "uniform", 0, 10)
      dim3 = Categorical("dim3", "abcde")
      space = Space()
      space.register(dim1)
      space.register(dim2)
      space.register(dim3)
  
      with caplog.at_level(
          logging.WARNING, logger="orion.algo.gridsearch"
      ):
          grid = GridSearch.build_grid(
              space, {k: 5 for k in space}, 100
          )
      assert len(grid) == 4 * 4 * 5
  
      assert (
          "`n_values` reduced by 1 to limit number of trials below 100"
          in caplog.text
      )
  
imports: from __future__ import annotations
  import logging
  import numpy.testing
  import pytest
  from orion.algo.gridsearch import GridSearch, categorical_grid, discrete_grid, grid, real_grid
  from orion.algo.space import Categorical, Integer, Real, Space
  from orion.testing.algo import BaseAlgoTests
label_desc: Use image node_id 13 for calling a global function with example usage: test_build_grid_limit_size(caplog) without return types