code: def get_results_as_xarray(self, parameter_space,
                                result_parsing_function,
                                output_labels, runs):
          
          np_array = np.array(
              self.get_space(
                  self.db.get_complete_results(), {},
                  collections.OrderedDict([(k, v) for k, v in
                                           parameter_space.items()]),
                  runs, result_parsing_function))
  
          # Create a parameter space only containing the variable parameters
          clean_parameter_space = collections.OrderedDict(
              [(k, v) for k, v in parameter_space.items()])
  
          clean_parameter_space['runs'] = range(runs)
  
          if isinstance(output_labels, list):
              clean_parameter_space['metrics'] = output_labels
  
          xr_array = xr.DataArray(np_array, coords=clean_parameter_space,
                                  dims=list(clean_parameter_space.keys()))
  
          return xr_array
docs: Return the results relative to the desired parameter space in the form
          of an xarray data structure.
  
          Args:
              parameter_space (dict): The space of parameters to export.
              result_parsing_function (function): user-defined function, taking a
                  result dictionary as argument, that can be used to parse the
                  result files and return a list of values.
              output_labels (list): a list of labels to apply to the results
                  dimensions, output by the result_parsing_function.
              runs (int): the number of runs to export for each parameter
                  combination.