code: def snap_to_nearest_config(x, tune_params):
      
      params = []
      for i, k in enumerate(tune_params.keys()):
          values = numpy.array(tune_params[k])
          idx = numpy.abs(values-x[i]).argmin()
          params.append(int(values[idx]))
      return params
docs: helper func that for each param selects the closest actual value