






'''simple docstring'''







from unittest.mock import Mock, patch

from file_transfer.send_file import send_file





@patch('''socket.socket'''      )
@patch('''builtins.open'''      )
def 		_UpperCAmelCase   (							__A							:   List[Any]						,		__A							:   List[Any]      ):
				# ===== initialization =====
				a_		:  str											=      Mock()
				a_		:  List[str]											=      conn, Mock()
				a_		:  Dict											=      iter([1, None]      )
				a_		:  List[str]											=      lambda __A      : next(__A      )

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

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







import warnings


warnings.warn(
    'memory_utils has been reorganized to utils.memory. Import `find_executable_batchsize` from the main `__init__`: '
    '`from accelerate import find_executable_batch_size` to avoid this warning.',
    FutureWarning,
)




