code: def real_grid(dim: Real, num: int):
      """Build real grid"""
      if dim.prior_name.endswith("reciprocal"):
          a, b = dim.interval()
          return list(_log_grid(a, b, num))
      elif dim.prior_name.endswith("uniform"):
          a, b = dim.interval()
          return list(_lin_grid(a, b, num))
      else:
          raise TypeError(
              "Grid Search only supports `loguniform`, `uniform` and `choices`: "
              f"`{dim.prior_name}`"
          )
  
imports: from __future__ import annotations
  import itertools
  import logging
  import numpy
  from orion.algo.base import BaseAlgorithm
  from orion.algo.space import Categorical, Dimension, Fidelity, Integer, Real, Space
  from orion.core.utils import format_trials
label_desc: Use image node_id 5 for calling a global function with example usage: real_grid(dim, num) and returns: list, list