


'''simple docstring'''
import copy
from typing import Dict, Optional

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING
from ..detr import DetrConfig
from ..swin import SwinConfig


__snake_case				 =	{
    '''facebook/maskformer-swin-base-ade''': (
        '''https://huggingface.co/facebook/maskformer-swin-base-ade/blob/main/config.json'''
    )
    # See all MaskFormer models at https://huggingface.co/models?filter=maskformer
}

__snake_case				 =	logging.get_logger(__name__)
class   lowercase      (				A__   ):

		"""simple docstring"""

		_a       					=							'maskformer'
		_a       					=							{'hidden_size': 'mask_feature_size'}
		_a       					=							['resnet', 'swin']
		_a       					=							['detr']




		def __init__(						self       ,  UpperCamelCase_ = 256       ,  UpperCamelCase_ = 256       ,  UpperCamelCase_ = 0.1       ,  UpperCamelCase_ = False       ,  UpperCamelCase_ = None       ,  UpperCamelCase_ = None       ,  UpperCamelCase_ = 0.02       ,  UpperCamelCase_ = 1.0       ,  UpperCamelCase_ = 1.0       ,  UpperCamelCase_ = 1.0       ,  UpperCamelCase_ = 20.0       ,  UpperCamelCase_ = None       ,  **UpperCamelCase_       ,  ):

							'''simple docstring'''


							if backbone_config is None:
												# fall back to https://huggingface.co/microsoft/swin-base-patch4-window12-384-in22k
												UpperCamelCase__  :Union[str, Any]				   =					SwinConfig(
												    image_size=384       ,  in_channels=3       ,  patch_size=4       ,  embed_dim=128       ,  depths=[2, 2, 18, 2]       ,  num_heads=[4, 8, 16, 32]       ,  window_size=12       ,  drop_path_rate=0.3       ,  out_features=['''stage1''', '''stage2''', '''stage3''', '''stage4''']       ,  )

							if isinstance(UpperCamelCase_       ,  UpperCamelCase_				):
												UpperCamelCase__  :Any				   =					backbone_config.pop('''model_type'''				)
												UpperCamelCase__  :Tuple				   =					CONFIG_MAPPING[backbone_model_type]
												UpperCamelCase__  :str				   =					config_class.from_dict(UpperCamelCase_				)

							# verify that the backbone is supported
							if backbone_config.model_type not in self.backbones_supported:
												logger.warning_once(
												    F'''Backbone {backbone_config.model_type} is not a supported model and may not be compatible with MaskFormer. '''
												    F'''Supported model types: {",".join(self.backbones_supported				)}'''				)

							if decoder_config is None:
												# fall back to https://huggingface.co/facebook/detr-resnet-50
												UpperCamelCase__  :Tuple				   =					DetrConfig()
							else:
												# verify that the decoder is supported
												UpperCamelCase__  :Any				   =					(
												    decoder_config.pop('''model_type'''				) if isinstance(UpperCamelCase_       ,  UpperCamelCase_				) else decoder_config.model_type
												)
												if decoder_type not in self.decoders_supported:
																	raise ValueError(
																	    F'''Transformer Decoder {decoder_type} not supported, please use one of'''
																	    F''' {",".join(self.decoders_supported				)}'''				)
												if isinstance(UpperCamelCase_       ,  UpperCamelCase_				):
																	UpperCamelCase__  :Union[str, Any]				   =					CONFIG_MAPPING[decoder_type]
																	UpperCamelCase__  :Any				   =					config_class.from_dict(UpperCamelCase_				)

							UpperCamelCase__  :Any				   =					backbone_config
							UpperCamelCase__  :Any				   =					decoder_config
							# main feature dimension for the model
							UpperCamelCase__  :int				   =					fpn_feature_size
							UpperCamelCase__  :Tuple				   =					mask_feature_size
							# initializer
							UpperCamelCase__  :Any				   =					init_std
							UpperCamelCase__  :Dict				   =					init_xavier_std
							# Hungarian matcher && loss
							UpperCamelCase__  :Dict				   =					cross_entropy_weight
							UpperCamelCase__  :Dict				   =					dice_weight
							UpperCamelCase__  :List[Any]				   =					mask_weight
							UpperCamelCase__  :Optional[Any]				   =					use_auxiliary_loss
							UpperCamelCase__  :str				   =					no_object_weight
							UpperCamelCase__  :Union[str, Any]				   =					output_auxiliary_logits

							UpperCamelCase__  :Dict				   =					self.decoder_config.encoder_attention_heads
							UpperCamelCase__  :Any				   =					self.decoder_config.num_hidden_layers
							super().__init__(**UpperCamelCase_				)




		@classmethod
		def        lowerCAmelCase__							(						cls       ,  UpperCamelCase_       ,  UpperCamelCase_       ,  **UpperCamelCase_				):

							'''simple docstring'''


							return cls(
							    backbone_config=UpperCamelCase_       ,  decoder_config=UpperCamelCase_       ,  **UpperCamelCase_       ,  )




		def        lowerCAmelCase__							(						self				):

							'''simple docstring'''


							UpperCamelCase__  :Dict				   =					copy.deepcopy(self.__dict__				)
							UpperCamelCase__  :Tuple				   =					self.backbone_config.to_dict()
							UpperCamelCase__  :Tuple				   =					self.decoder_config.to_dict()
							UpperCamelCase__  :List[Any]				   =					self.__class__.model_type
							return output



'''simple docstring'''
import requests
from bsa import BeautifulSoup


def      a (     __a = "AAPL"  )    ->      str:



					'''simple docstring'''






					UpperCamelCase__  :str				   =					f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}'''
					UpperCamelCase__  :Tuple				   =					BeautifulSoup(requests.get(__a  ).text					,   '''html.parser'''  )
					UpperCamelCase__  :Tuple				   =					'''My(6px) Pos(r) smartphone_Mt(6px)'''
					return soup.find('''div'''					,   class_=class_  ).find('''span'''  ).text


if __name__ == "__main__":
		for symbol in "AAPL AMZN IBM GOOG MSFT ORCL".split():
				print(F"""Current {symbol:<4} stock price is {stock_price(symbol):>8}""")