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  ,      SCREAMING_SNAKE_CASE     ):
				'''simple docstring'''







				__UpperCamelCase					:Any        =		Mock()
				__UpperCamelCase					:int        =		conn, Mock()
				__UpperCamelCase					:Union[str, Any]        =		iter([1, None]     )
				__UpperCamelCase					:Tuple        =		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()






from ...utils import is_note_seq_available, is_transformers_available, is_torch_available
from ...utils import OptionalDependencyNotAvailable


try:
    if not (is_transformers_available() and is_torch_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from ...utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
    from .notes_encoder import SpectrogramNotesEncoder
    from .continous_encoder import SpectrogramContEncoder
    from .pipeline_spectrogram_diffusion import (
        SpectrogramContEncoder,
        SpectrogramDiffusionPipeline,
        TaFilmDecoder,
    )

try:
    if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from ...utils.dummy_transformers_and_torch_and_note_seq_objects import *  # noqa F403
else:
    from .midi_utils import MidiProcessor





