


'''simple docstring'''

import copy
import os
from typing import Union

from ...configuration_utils import PretrainedConfig
from ...utils import logging


_UpperCAmelCase				: Optional[Any]							    =				logging.get_logger(__name__)

_UpperCAmelCase				: List[Any]							    =				{
    '''BridgeTower/bridgetower-base''': '''https://huggingface.co/BridgeTower/bridgetower-base/blob/main/config.json''',
    '''BridgeTower/bridgetower-base-itm-mlm''': (
        '''https://huggingface.co/BridgeTower/bridgetower-base-itm-mlm/blob/main/config.json'''
    ),
}


class       a__				( _UpperCAmelCase      ):







				"""simple docstring"""



				__UpperCamelCase    :		str	=	'bridgetower_vision_model'




				def __init__(self       ,			__lowercase=7_68       ,			__lowercase=12       ,			__lowercase=3       ,			__lowercase=16       ,			__lowercase=2_88       ,			__lowercase=1       ,			__lowercase=1e-05       ,			__lowercase=False       ,			__lowercase=True       ,			__lowercase=False       ,			**__lowercase       ,			):
										super().__init__(**__UpperCamelCase		)
										__lowerCAmelCase							       =				hidden_size
										__lowerCAmelCase							       =				num_hidden_layers
										__lowerCAmelCase							       =				num_channels
										__lowerCAmelCase							       =				patch_size
										__lowerCAmelCase							       =				image_size
										__lowerCAmelCase							       =				initializer_factor
										__lowerCAmelCase							       =				layer_norm_eps
										__lowerCAmelCase							       =				stop_gradient
										__lowerCAmelCase							       =				share_layernorm
										__lowerCAmelCase							       =				remove_last_layer




				@classmethod
				def 					lowercase  (cls       ,			__lowercase       ,			**__lowercase		):
										__lowerCAmelCase       ,					__lowerCAmelCase							       =				cls.get_config_dict(__UpperCamelCase       ,			**__UpperCamelCase		)

										if config_dict.get('''model_type'''		) == "bridgetower":
																__lowerCAmelCase							       =				config_dict['''text_config''']

										if "model_type" in config_dict and hasattr(cls       ,			'''model_type'''		) and config_dict["model_type"] != cls.model_type:
																logger.warning(
																    F"""You are using a model of type {config_dict["model_type"]} to instantiate a model of type """
																    F"""{cls.model_type}. This is not supported for all configurations of models and can yield errors."""		)

										return cls.from_dict(__UpperCamelCase       ,			**__UpperCamelCase		)


class       a__				( _UpperCAmelCase      ):







				"""simple docstring"""



				__UpperCamelCase    :		List[Any]	=	'bridgetower_text_model'




				def __init__(self       ,			__lowercase=5_02_65       ,			__lowercase=7_68       ,			__lowercase=12       ,			__lowercase=12       ,			__lowercase=1       ,			__lowercase=30_72       ,			__lowercase="gelu"       ,			__lowercase=0.1       ,			__lowercase=0.1       ,			__lowercase=5_14       ,			__lowercase=1       ,			__lowercase=1e-05       ,			__lowercase=1       ,			__lowercase=0       ,			__lowercase=2       ,			__lowercase="absolute"       ,			__lowercase=True       ,			**__lowercase       ,			):
										super().__init__(**__UpperCamelCase		)

										__lowerCAmelCase							       =				vocab_size
										__lowerCAmelCase							       =				hidden_size
										__lowerCAmelCase							       =				num_hidden_layers
										__lowerCAmelCase							       =				num_attention_heads
										__lowerCAmelCase							       =				hidden_act
										__lowerCAmelCase							       =				initializer_factor
										__lowerCAmelCase							       =				intermediate_size
										__lowerCAmelCase							       =				hidden_dropout_prob
										__lowerCAmelCase							       =				attention_probs_dropout_prob
										__lowerCAmelCase							       =				max_position_embeddings
										__lowerCAmelCase							       =				type_vocab_size
										__lowerCAmelCase							       =				layer_norm_eps
										__lowerCAmelCase							       =				position_embedding_type
										__lowerCAmelCase							       =				use_cache
										__lowerCAmelCase							       =				pad_token_id
										__lowerCAmelCase							       =				bos_token_id
										__lowerCAmelCase							       =				eos_token_id




				@classmethod
				def 					lowercase  (cls       ,			__lowercase       ,			**__lowercase		):
										__lowerCAmelCase       ,					__lowerCAmelCase							       =				cls.get_config_dict(__UpperCamelCase       ,			**__UpperCamelCase		)

										if config_dict.get('''model_type'''		) == "bridgetower":
																__lowerCAmelCase							       =				config_dict['''text_config''']

										if "model_type" in config_dict and hasattr(cls       ,			'''model_type'''		) and config_dict["model_type"] != cls.model_type:
																logger.warning(
																    F"""You are using a model of type {config_dict["model_type"]} to instantiate a model of type """
																    F"""{cls.model_type}. This is not supported for all configurations of models and can yield errors."""		)

										return cls.from_dict(__UpperCamelCase       ,			**__UpperCamelCase		)


class       a__				( _UpperCAmelCase      ):







				"""simple docstring"""



				__UpperCamelCase    :		Dict	=	'bridgetower'




				def __init__(self       ,			__lowercase=True       ,			__lowercase="gelu"       ,			__lowercase=7_68       ,			__lowercase=1       ,			__lowercase=1e-05       ,			__lowercase=False       ,			__lowercase="add"       ,			__lowercase=12       ,			__lowercase=6       ,			__lowercase=False       ,			__lowercase=False       ,			__lowercase=None       ,			__lowercase=None       ,			**__lowercase       ,			):
										__lowerCAmelCase							       =				kwargs.pop('''text_config_dict'''       ,			__UpperCamelCase		)
										__lowerCAmelCase							       =				kwargs.pop('''vision_config_dict'''       ,			__UpperCamelCase		)

										super().__init__(**__UpperCamelCase		)
										__lowerCAmelCase							       =				share_cross_modal_transformer_layers
										__lowerCAmelCase							       =				hidden_act
										__lowerCAmelCase							       =				hidden_size
										__lowerCAmelCase							       =				initializer_factor
										__lowerCAmelCase							       =				layer_norm_eps
										__lowerCAmelCase							       =				share_link_tower_layers
										__lowerCAmelCase							       =				link_tower_type
										__lowerCAmelCase							       =				num_attention_heads
										__lowerCAmelCase							       =				num_hidden_layers
										__lowerCAmelCase							       =				tie_word_embeddings
										__lowerCAmelCase							       =				init_layernorm_from_vision_encoder

										if text_config is None:
																__lowerCAmelCase							       =				{}
																logger.info('''`text_config` is `None`. Initializing the `BridgeTowerTextConfig` with default values.'''		)

										if vision_config is None:
																__lowerCAmelCase							       =				{}
																logger.info('''`vision_config` is `None`. Initializing the `BridgeTowerVisionConfig` with default values.'''		)

										__lowerCAmelCase							       =				BridgeTowerTextConfig(**__UpperCamelCase		)
										__lowerCAmelCase							       =				BridgeTowerVisionConfig(**__UpperCamelCase		)




				@classmethod
				def 					lowercase  (cls       ,			__lowercase       ,			__lowercase       ,			**__lowercase		):
										return cls(text_config=text_config.to_dict()       ,			vision_config=vision_config.to_dict()       ,			**__UpperCamelCase		)




				def 					lowercase  (self		):
										__lowerCAmelCase							       =				copy.deepcopy(self.__dict__		)
										__lowerCAmelCase							       =				self.text_config.to_dict()
										__lowerCAmelCase							       =				self.vision_config.to_dict()
										__lowerCAmelCase							       =				self.__class__.model_type
										return output





'''simple docstring'''

from __future__ import annotations

def 							__magic_name__(						lowerCamelCase,				lowerCamelCase):
						__lowerCAmelCase							       =				sorted(numsa + numsa)
						__lowerCAmelCase       ,					__lowerCAmelCase							       =				divmod(len(lowerCamelCase),				2)
						if mod == 1:
												return all_numbers[div]
						else:
												return (all_numbers[div] + all_numbers[div - 1]) / 2


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	_UpperCAmelCase				: Union[str, Any]							    =				[float(x) for x in input("""Enter the elements of first array: """).split()]
	_UpperCAmelCase				: int							    =				[float(x) for x in input("""Enter the elements of second array: """).split()]
	print(f"""The median of two arrays is: {median_of_two_arrays(array_a, array_a)}""")

