




import socket

def 						snake_case__       (					)			->Dict:






		"""simple docstring"""


		__lowercase				:		str												=				socket.socket(socket.AF_INET,  socket.SOCK_STREAM				)
		__lowercase				:		str												=				socket.gethostname()
		__lowercase				:		Optional[int]												=				1_23_12

		sock.connect((host, port)				)
		sock.send(b"Hello server!"				)

		with open("Received_file",  "wb"				) as out_file:
				print("File opened"				)
				print("Receiving data..."				)
				while True:
						__lowercase				:		Dict												=				sock.recv(10_24				)
						if not data:
								break
						out_file.write(_lowerCamelCase				)

		print("Successfully received the file"				)
		sock.close()
		print("Connection closed"				)


if __name__ == "__main__":
						main()






"""simple docstring"""







from __future__ import annotations

import numpy as np
from numpy import floataa
from numpy.typing import NDArray

def 						snake_case__       (					_lowerCamelCase,  _lowerCamelCase,  _lowerCamelCase,  _lowerCamelCase,  )			->list[float]:






		"""simple docstring"""


		__lowercase						,__lowercase				:		Dict												=				coefficient_matrix.shape
		__lowercase						,__lowercase				:		Tuple												=				constant_matrix.shape

		if rowsa != colsa:
				__lowercase				:		str												=				F'Coefficient matrix dimensions must be nxn but received {rowsa}x{colsa}'
				raise ValueError(_lowerCamelCase				)

		if colsa != 1:
				__lowercase				:		Dict												=				F'Constant matrix must be nx1 but received {rowsa}x{colsa}'
				raise ValueError(_lowerCamelCase				)

		if rowsa != rowsa:
				__lowercase				:		Optional[Any]												=				(
				    "Coefficient and constant matrices dimensions must be nxn and nx1 but "
				    F'received {rowsa}x{colsa} and {rowsa}x{colsa}'
				)
				raise ValueError(_lowerCamelCase				)

		if len(_lowerCamelCase				) != rowsa:
				__lowercase				:		Dict												=				(
				    "Number of initial values must be equal to number of rows in coefficient "
				    F'matrix but received {len(_lowerCamelCase				)} and {rowsa}'
				)
				raise ValueError(_lowerCamelCase				)

		if iterations <= 0:
				raise ValueError("Iterations must be at least 1"				)

		__lowercase				:		NDArray[floataa]												=				np.concatenate(
		    (coefficient_matrix, constant_matrix),  axis=1				)

		__lowercase						,__lowercase				:		str												=				table.shape

		strictly_diagonally_dominant(_lowerCamelCase				)

		# Iterates the whole matrix for given number of times
		for _ in range(_lowerCamelCase				):
				__lowercase				:		List[Any]												=				[]
				for row in range(_lowerCamelCase				):
						__lowercase				:		Optional[Any]												=				0
						for col in range(_lowerCamelCase				):
								if col == row:
										__lowercase				:		Tuple												=				table[row][col]
								elif col == cols - 1:
										__lowercase				:		Tuple												=				table[row][col]
								else:
										temp += (-1) * table[row][col] * init_val[col]
						__lowercase				:		List[Any]												=				(temp + val) / denom
						new_val.append(_lowerCamelCase				)
				__lowercase				:		Dict												=				new_val

		return [float(_lowerCamelCase				) for i in new_val]

def 						snake_case__       (					_lowerCamelCase				)			->bool:






		"""simple docstring"""


		__lowercase						,__lowercase				:		int												=				table.shape

		__lowercase				:		Optional[int]												=				True

		for i in range(0,  _lowerCamelCase				):
				__lowercase				:		Optional[int]												=				0
				for j in range(0,  cols - 1				):
						if i == j:
								continue
						else:
								total += table[i][j]

				if table[i][i] <= total:
						raise ValueError("Coefficient matrix is not strictly diagonally dominant"				)

		return is_diagonally_dominant


# Test Cases
if __name__ == "__main__":
						import doctest

						doctest.testmod()
