code: def get_single_random_path(
      predict_function,
      data_sample,
      new_observation,
      variable_groups,
      random_path,
      b,
  ):
      current_data = deepcopy(data_sample)
      current_data.reset_index(inplace=True, drop=True)
      variable_groups_varnames = list(variable_groups.values())
      variable_groups_aspnames = list(variable_groups.keys())
      yhats = np.empty(len(random_path) + 1)
      yhats[0] = predict_function(current_data).mean()
      for i, candidate in enumerate(random_path):
          variables = variable_groups_varnames[candidate]
          for var in variables:
              current_data.loc[:, var] = new_observation.iloc[0][var]
          yhats[i + 1] = predict_function(current_data).mean()
  
      diffs = np.diff(yhats)
      variable_names = [
          variable_groups_varnames[i] for i in random_path
      ]
      aspect_name = [variable_groups_aspnames[i] for i in random_path]
  
      return pd.DataFrame(
          {
              "aspect_name": aspect_name,
              "variable_names": variable_names,
              "importance": diffs,
              "B": b,
          }
      )
  
file_path: DALEX/python/dalex/dalex/aspect/_predict_aspect_importance/utils.py
imports: import numpy
  import pandas
  from copy import deepcopy
  import multiprocessing
  from dalex import _global_checks
label_desc: Use image node_id 5 for calling a global function with example usage: get_single_random_path(predict_function, data_sample, new_observation, variable_groups, random_path, b) and returns: pd