<commit_before>import numpy as np

class Gaussian:
	"""
	An object of this class is a 2D elliptical gaussian
	"""
	def __init__(self):
		"""
		Constructor sets up a standard gaussian
		"""
		self.xc, self.yc, self.mass, self.width, self.q, self.theta =\
						0., 0., 1., 1., 1., 0.
		self.cos_theta, self.sin_theta = np.cos(self.theta), np.sin(self.theta)

	def evaluate(self, x, y):
		"""
		Evaluate the density.
		"""
		xx =  (x - self.xc)*self.cos_theta + (y - self.yc)*self.sin_theta
		yy = -(x - self.xc)*self.sin_theta + (y - self.yc)*self.cos_theta
		rsq = self.q*xx**2 + yy**2/self.q
		f = np.exp(-0.5*rsq/(self.width**2)**2)
		f *= self.mass/(2.*np.pi*self.width**2)
		return f

if __name__ == '__main__':
	pass

<commit_msg>Make an image of a gaussian<commit_after>import numpy as np

class Gaussian:
	"""
	An object of this class is a 2D elliptical gaussian
	"""
	def __init__(self):
		"""
		Constructor sets up a standard gaussian
		"""
		self.xc, self.yc, self.mass, self.width, self.q, self.theta =\
						0., 0., 1., 1., 1., 0.

	def evaluate(self, x, y):
		"""
		Evaluate the density.
		"""
		xx =  (x - self.xc)*np.cos(self.theta) + (y - self.yc)*np.sin(self.theta)
		yy = -(x - self.xc)*np.sin(self.theta) + (y - self.yc)*np.cos(self.theta)
		rsq = self.q*xx**2 + yy**2/self.q
		f = np.exp(-0.5*rsq/(self.width**2)**2)
		f *= self.mass/(2.*np.pi*self.width**2)
		return f

if __name__ == '__main__':
	import matplotlib.pyplot as plt

	# Set up cartesian coordinate grid
	x = np.linspace(-5., 5., 1001)
	[x, y] = np.meshgrid(x, x[::-1])

	# Make a gaussian
	gaussian = Gaussian()
	gaussian.q = 0.5
	gaussian.theta = 30.*np.pi/180.
	f = gaussian.evaluate(x, y)
	print(f.sum()*(x[0, 1] - x[0, 0])**2)

	plt.imshow(f, interpolation='nearest')
	plt.show()


{'fraction_non_alphanumeric': 0.19706380575945792, 'fraction_numerical': 0.02766798418972332, 'mean_word_length': 3.045662100456621, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4084500', 'n_tokens_mistral': 811, 'n_tokens_neox': 734, 'n_words': 176}