
'''simple docstring'''







from unittest.mock import Mock, patch

from file_transfer.send_file import send_file
@patch('''socket.socket'''							)
@patch('''builtins.open'''							)
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			List[str]				,				__SCREAMING_SNAKE_CASE :			Optional[Any]							):



						"""simple docstring"""





						lowercase_     :					List[str]													=	Mock()
						lowercase_     :					Tuple													=	conn, Mock()
						lowercase_     :					List[str]													=	iter([1, None]							)
						lowercase_     :					Tuple													=	lambda __SCREAMING_SNAKE_CASE							: next(lowerCAmelCase__							)

						# ===== invoke =====
						send_file(filename='''mytext.txt'''				,				testing=lowerCAmelCase__							)

						# ===== ensurance =====
						sock.assert_called_once()
						sock.return_value.bind.assert_called_once()
						sock.return_value.listen.assert_called_once()
						sock.return_value.accept.assert_called_once()
						conn.recv.assert_called_once()

						file.return_value.__enter__.assert_called_once()
						file.return_value.__enter__.return_value.read.assert_called()

						conn.send.assert_called_once()
						conn.close.assert_called_once()
						sock.return_value.shutdown.assert_called_once()
						sock.return_value.close.assert_called_once()





'''simple docstring'''







from PIL import Image
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			Image				,				__SCREAMING_SNAKE_CASE :			int							):



						"""simple docstring"""





						lowercase_     :					Optional[int]													=	(259 * (level + 255)) / (255 * (259 - level))

						def contrast(__SCREAMING_SNAKE_CASE :			int							) -> int:
												return int(128 + factor * (c - 128)							)

						return img.point(__SCREAMING_SNAKE_CASE							)


if __name__ == "__main__":
							# Load image
							with Image.open("image_data/lena.jpg") as img:
														# Change contrast to 170
														_lowercase			:  Union[str, Any]   							=	change_contrast(img, 1_7_0)
														cont_img.save("image_data/lena_high_contrast.png", format="png")



