





"""simple docstring"""





from unittest.mock import Mock, patch

from file_transfer.send_file import send_file



@patch('''socket.socket'''   )
@patch('''builtins.open'''   )
def 				lowerCAmelCase_			(      SCREAMING_SNAKE_CASE       :							str    ,						SCREAMING_SNAKE_CASE       :							int   ):


							'''simple docstring'''







							__lowerCamelCase      :      Union[str, Any]         =Mock()
							__lowerCamelCase      :      int         =conn, Mock()
							__lowerCamelCase      :      int         =iter([1, None]   )
							__lowerCamelCase      :      Optional[int]         =lambda SCREAMING_SNAKE_CASE   : next(SCREAMING_SNAKE_CASE   )

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

							# ===== 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"""





def 				lowerCAmelCase_			(      SCREAMING_SNAKE_CASE       :							list    ,						SCREAMING_SNAKE_CASE       :							list    ,						SCREAMING_SNAKE_CASE       :							int   ):


							'''simple docstring'''







							__lowerCamelCase      :      Optional[Any]         =len(SCREAMING_SNAKE_CASE   )
							__lowerCamelCase      :      Union[str, Any]         =[[0] * n for i in range(SCREAMING_SNAKE_CASE   )]
							for i in range(SCREAMING_SNAKE_CASE   ):
														__lowerCamelCase      :      Union[str, Any]         =y_points[i]

							for i in range(2    ,						SCREAMING_SNAKE_CASE   ):
														for j in range(SCREAMING_SNAKE_CASE    ,						SCREAMING_SNAKE_CASE   ):
																					__lowerCamelCase      :      List[Any]         =(
																					    (xa - x_points[j - i + 1]) * q[j][i - 1]
																					    - (xa - x_points[j]) * q[j - 1][i - 1]
																					) / (x_points[j] - x_points[j - i + 1])

							return [q[n - 1][n - 1], q]


if __name__ == "__main__":
							import doctest

							doctest.testmod()




