





from cva import destroyAllWindows, imread, imshow, waitKey





def lowerCAmelCase__(__snake_case							)       ->   Any:







	'''simple docstring'''







	lowerCamelCase__       ,			lowerCamelCase__              =	img.shape[0], img.shape[1]

	# converting each pixel's color to its negative
	for i in range(__snake_case							):
		for j in range(__snake_case							):
			lowerCamelCase__              =	[255, 255, 255] - img[i][j]

	return img


if __name__ == "__main__":
			# read original image
			_a						=   imread("image_data/lena.jpg", 1)

			# convert to its negative
			_a						=   convert_to_negative(img)

			# show result image
			imshow("negative of original image", img)
			waitKey(0)
			destroyAllWindows()










import string
from math import logaa





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   int:







	'''simple docstring'''







	lowerCamelCase__              =	document.translate(
	    str.maketrans('''''' ,'''''' ,string.punctuation							)							).replace('''\n''' ,''''''							)
	lowerCamelCase__              =	document_without_punctuation.split(''' '''							)  # word tokenization
	return len([word for word in tokenize_document if word.lower() == term.lower()]							)





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   tuple[int, int]:







	'''simple docstring'''







	lowerCamelCase__              =	corpus.lower().translate(
	    str.maketrans('''''' ,'''''' ,string.punctuation							)							)  # strip all punctuation and replace it with ''
	lowerCamelCase__              =	corpus_without_punctuation.split('''\n'''							)
	lowerCamelCase__              =	term.lower()
	return (len([doc for doc in docs if term in doc]							), len(__snake_case							))





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case=False							)       ->   float:







	'''simple docstring'''







	if smoothing:
		if n == 0:
			raise ValueError('''log10(0) is undefined.'''							)
		return round(1 + logaa(n / (1 + df)							) ,3							)

	if df == 0:
		raise ZeroDivisionError('''df must be > 0'''							)
	elif n == 0:
		raise ValueError('''log10(0) is undefined.'''							)
	return round(logaa(n / df							) ,3							)





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   float:







	'''simple docstring'''







	return round(tf * idf ,3							)



