Gaussian kernel density weight question (in Python)

Hi, I'm trying to decipher some code ...

class Gaussian(BaseKernel):

def _compute_weights(self):
if not self.fix_boundary:

weights = np.zeros([0])
for i,d in enumerate(
weights = 2./(erf((1-d)/(np.sqrt(2)* + erf(d/(np.sqrt(2)*


def __call__(self, x_test):
distances = x_test[None,:] -[:,None]
pdfs = np.exp(-0.5* np.power(distances/, 2))/(2.5066282746310002 *

# reweigh to compensate for boundaries
pdfs *= self.weights


I do not understand what is going on here in compute_weights. I believe the data may be restricted to values between 0 and 1 (or else you are trying to combine a numerical literal with a distance with arbitrary scale in (1 - d) ) - which would make it a truncated normal situation. On the other hand, it could be related to boundary correction (reflection method?). It's bound to be something simple but have read all I can and done the research but need a hint as to what's going on. Any thoughts appreciated. Thank you.