


"""simple docstring"""

from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCAmelCase__					=logging.get_logger(__name__)

UpperCAmelCase__					={
    "microsoft/beit-base-patch16-224-pt22k": (
        "https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json"
    ),
    # See all BEiT models at https://huggingface.co/models?filter=beit
}





class  lowerCamelCase__    (		_a     ):
      a			:  Optional[int]           =		"""beit"""
      def __init__(		self						:						int   ,							A_						:						List[str]=8_1_9_2   ,							A_						:						Tuple=7_6_8   ,							A_						:						str=1_2   ,							A_						:						Optional[Any]=1_2   ,							A_						:						List[str]=3_0_7_2   ,							A_						:						Any="gelu"   ,							A_						:						List[Any]=0.0   ,							A_						:						Optional[int]=0.0   ,							A_						:						List[str]=0.02   ,							A_						:						Tuple=1e-1_2   ,							A_						:						str=2_2_4   ,							A_						:						str=1_6   ,							A_						:						Any=3   ,							A_						:						str=False   ,							A_						:						List[str]=False   ,							A_						:						Any=False   ,							A_						:						Dict=False   ,							A_						:						Optional[Any]=0.1   ,							A_						:						Optional[int]=0.1   ,							A_						:						Optional[Any]=True   ,							A_						:						Any=[3, 5, 7, 1_1]   ,							A_						:						Dict=[1, 2, 3, 6]   ,							A_						:						List[str]=True   ,							A_						:						Optional[int]=0.4   ,							A_						:						Optional[int]=2_5_6   ,							A_						:						int=1   ,							A_						:						Tuple=False   ,							A_						:						List[Any]=2_5_5   ,							**A_						:						Optional[Any]   ,							):






       '''simple docstring'''


       super().__init__(**A_				)

       __lowercase						=						vocab_size
       __lowercase						=						hidden_size
       __lowercase						=						num_hidden_layers
       __lowercase						=						num_attention_heads
       __lowercase						=						intermediate_size
       __lowercase						=						hidden_act
       __lowercase						=						hidden_dropout_prob
       __lowercase						=						attention_probs_dropout_prob
       __lowercase						=						initializer_range
       __lowercase						=						layer_norm_eps

       __lowercase						=						image_size
       __lowercase						=						patch_size
       __lowercase						=						num_channels
       __lowercase						=						use_mask_token
       __lowercase						=						use_absolute_position_embeddings
       __lowercase						=						use_relative_position_bias
       __lowercase						=						use_shared_relative_position_bias
       __lowercase						=						layer_scale_init_value
       __lowercase						=						drop_path_rate
       __lowercase						=						use_mean_pooling
       # decode head attributes (semantic segmentation)
       __lowercase						=						out_indices
       __lowercase						=						pool_scales
       # auxiliary head attributes (semantic segmentation)
       __lowercase						=						use_auxiliary_head
       __lowercase						=						auxiliary_loss_weight
       __lowercase						=						auxiliary_channels
       __lowercase						=						auxiliary_num_convs
       __lowercase						=						auxiliary_concat_input
       __lowercase						=						semantic_loss_ignore_index






class  lowerCamelCase__    (		_a     ):
      a			:  int           =		version.parse("""1.11"""     )
      @property
      def SCREAMING_SNAKE_CASE_						(		self						:						Tuple				):






       '''simple docstring'''


       return OrderedDict(
           [
               ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
           ]				)






      @property
      def SCREAMING_SNAKE_CASE_						(		self						:						List[Any]				):






       '''simple docstring'''


       return 1e-4




"""simple docstring"""

import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline


@pytest.mark.integration
def lowerCAmelCase_   (					):






 """simple docstring"""







 with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT			):
  with pytest.raises(UpperCamelCase__			):
   requests.request("""GET"""					, """https://huggingface.co"""			)
  with pytest.raises(requests.exceptions.ConnectTimeout			):
   requests.request("""GET"""					, """https://huggingface.co"""					, timeout=1.0			)


@pytest.mark.integration
def lowerCAmelCase_   (					):






 """simple docstring"""







 with offline(OfflineSimulationMode.CONNECTION_FAILS			):
  with pytest.raises(requests.exceptions.ConnectionError			):
   requests.request("""GET"""					, """https://huggingface.co"""			)


def lowerCAmelCase_   (					):






 """simple docstring"""







 with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1			):
  with pytest.raises(UpperCamelCase__			):
   http_head("""https://huggingface.co"""			)
