code: def unscale_and_snap_to_nearest(x, tune_params, eps):
      
      x_u = [i for i in x]
      for i, v in enumerate(tune_params.values()):
          #create an evenly spaced linear space to map [0,1]-interval
          #to actual values, giving each value an equal chance
          #pad = 0.5/len(v)  #use when interval is [0,1]
          pad = 0.5*eps      #use when interval is [0, eps*len(v)]
          linspace = numpy.linspace(pad, (eps*len(v))-pad, len(v))
  
          #snap value to nearest point in space, store index
          idx = numpy.abs(linspace-x[i]).argmin()
  
          #safeguard that should not be needed
          idx = min(max(idx, 0), len(v)-1)
  
          #use index into array of actual values
          x_u[i] = v[idx]
      return x_u
docs: helper func that snaps a scaled variable to the nearest config