def _weight(self, rsq, sigma=None):
sigma = sigma or self.filter_size<EOL>if not self.clip:<EOL><INDENT>o = np.exp(-rsq / (<NUM_LIT:2>*sigma**<NUM_LIT:2>))<EOL><DEDENT>else:<EOL><INDENT>o = np.zeros(rsq.shape, dtype='<STR_LIT:float>')<EOL>m = (rsq < self.clipsize**<NUM_LIT:2>)<EOL>o[m] = np.exp(-rsq[m] / (<NUM_LIT:2>*sigma**<NUM_LIT:2>))<EOL><DEDENT>return o<EOL>
weighting function for Barnes