


"""simple docstring"""


import logging
from dataclasses import dataclass, field
from typing import Optional

from seqaseq_trainer import arg_to_scheduler

from transformers import TrainingArguments


UpperCamelCase						:				Any             =      logging.getLogger(__name__)



@dataclass
class 			lowerCamelCase__						(   UpperCAmelCase_			):
						lowerCAmelCase       =     field(
						    default=0.0							,    metadata={"""help""": """The label smoothing epsilon to apply (if not zero)."""}			)
						lowerCAmelCase       =     field(default=UpperCAmelCase_							,    metadata={"""help""": """Whether to SortishSamler or not."""}			)
						lowerCAmelCase       =     field(
						    default=UpperCAmelCase_							,    metadata={"""help""": """Whether to use generate to calculate generative metrics (ROUGE, BLEU)."""}			)
						lowerCAmelCase       =     field(default=UpperCAmelCase_							,    metadata={"""help""": """whether to use adafactor"""}			)
						lowerCAmelCase       =     field(
						    default=UpperCAmelCase_							,    metadata={"""help""": """Encoder layer dropout probability. Goes into model.config."""}			)
						lowerCAmelCase       =     field(
						    default=UpperCAmelCase_							,    metadata={"""help""": """Decoder layer dropout probability. Goes into model.config."""}			)
						lowerCAmelCase       =     field(default=UpperCAmelCase_							,    metadata={"""help""": """Dropout probability. Goes into model.config."""}			)
						lowerCAmelCase       =     field(
						    default=UpperCAmelCase_							,    metadata={"""help""": """Attention dropout probability. Goes into model.config."""}			)
						lowerCAmelCase       =     field(
						    default="""linear"""							,    metadata={"""help""": F'''Which lr scheduler to use. Selected in {sorted(arg_to_scheduler.keys()			)}'''}							,    )









"""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       (   UpperCamelCase__ ,			UpperCamelCase__	)      ->		Dict:







		"""simple docstring"""





		A					       = Mock()
		A					       = conn, Mock()
		A					       = iter([1, None]	)
		A					       = lambda UpperCamelCase__	: next(UpperCamelCase__	)

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

		# ===== 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()





