



'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


UpperCamelCase__ :			Dict												=				{
    '''configuration_groupvit''': [
        '''GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''GroupViTConfig''',
        '''GroupViTOnnxConfig''',
        '''GroupViTTextConfig''',
        '''GroupViTVisionConfig''',
    ],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						UpperCamelCase__ :			List[Any]												=				[
						    '''GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''GroupViTModel''',
						    '''GroupViTPreTrainedModel''',
						    '''GroupViTTextModel''',
						    '''GroupViTVisionModel''',
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						UpperCamelCase__ :			int												=				[
						    '''TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''TFGroupViTModel''',
						    '''TFGroupViTPreTrainedModel''',
						    '''TFGroupViTTextModel''',
						    '''TFGroupViTVisionModel''',
						]

if TYPE_CHECKING:
						from .configuration_groupvit import (
						    GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    GroupViTConfig,
						    GroupViTOnnxConfig,
						    GroupViTTextConfig,
						    GroupViTVisionConfig,
						)

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_groupvit import (
												    GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    GroupViTModel,
												    GroupViTPreTrainedModel,
												    GroupViTTextModel,
												    GroupViTVisionModel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_groupvit import (
												    TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFGroupViTModel,
												    TFGroupViTPreTrainedModel,
												    TFGroupViTTextModel,
												    TFGroupViTVisionModel,
												)

else:
						import sys

						UpperCamelCase__ :			List[Any]												=				_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)







'''simple docstring'''




from unittest.mock import Mock, patch

from file_transfer.send_file import send_file


@patch("""socket.socket"""      )
@patch("""builtins.open"""      )
def        lowerCAmelCase_     (			_lowerCamelCase:     Dict ,   _lowerCamelCase:     List[Any]      ):
		# ===== initialization =====
		__SCREAMING_SNAKE_CASE :	Optional[int]					 =	Mock()
		__SCREAMING_SNAKE_CASE :	Optional[int]					 =	conn, Mock()
		__SCREAMING_SNAKE_CASE :	str					 =	iter([1, None]      )
		__SCREAMING_SNAKE_CASE :	Any					 =	lambda _lowerCamelCase      : next(_lowerCamelCase      )

		# ===== invoke =====
		send_file(filename="""mytext.txt""" ,   testing=_lowerCamelCase      )

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