code: def partial_dependency_grid(
      space, model, params, samples, n_points=40
  ):
      """Compute the dependency grid for a given set of params (1 or 2)"""
  
      samples = copy.deepcopy(samples)
  
      grids = {}
      for name in params:
          grids[name] = make_grid(space[name], n_points)
  
      lengths = [len(grids[name]) for name in params]
      averages = numpy.zeros(lengths)
      stds = numpy.zeros(lengths)
  
      indexed_combinations = zip(
          itertools.product(
              *(list(range(length)) for length in lengths)
          ),
          itertools.product(*grids.values()),
      )
      for z_idx, combination in indexed_combinations:
          for i, name in enumerate(params):
              samples[name] = combination[i]
  
          predictions = model.predict(samples.to_numpy())
          averages[z_idx] = numpy.mean(predictions)
          stds[z_idx] = numpy.std(predictions)
  
      return grids, averages.T, stds.T
  
file_path: orion/src/orion/analysis/partial_dependency_utils.py
imports: import copy
  import itertools
  import numpy
  import pandas
  from orion.analysis.base import flatten_numpy, flatten_params, to_numpy, train_regressor
  from orion.core.utils import format_trials
  from orion.core.worker.transformer import build_required_space
label_desc: Use image node_id 4 for calling a global function with example usage: partial_dependency_grid(space, model, params, samples, n_points) and returns: grids,  averages,  stds