





from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__lowerCamelCase       :     str   =     logging.get_logger(__name__)

__lowerCamelCase       :     str   =     {
    """facebook/convnextv2-tiny-1k-224""": """https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json""",
}



class 					A__   (       __snake_case       ,   __snake_case			):
      _UpperCAmelCase	:Optional[int]						    =   'convnextv2'





      def __init__( self       ,							A_=3       ,							A_=4       ,							A_=4       ,							A_=None       ,							A_=None       ,							A_="gelu"       ,							A_=0.02       ,							A_=1e-12       ,							A_=0.0       ,							A_=224       ,							A_=None       ,							A_=None       ,							**A_       ,							):
       '''simple docstring'''




       super().__init__(**A_   )

       UpperCamelCase	:					Dict       	=   num_channels
       UpperCamelCase	:					Union[str, Any]       	=   patch_size
       UpperCamelCase	:					Union[str, Any]       	=   num_stages
       UpperCamelCase	:					List[Any]       	=   [96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
       UpperCamelCase	:					List[str]       	=   [3, 3, 9, 3] if depths is None else depths
       UpperCamelCase	:					Dict       	=   hidden_act
       UpperCamelCase	:					Union[str, Any]       	=   initializer_range
       UpperCamelCase	:					Tuple       	=   layer_norm_eps
       UpperCamelCase	:					str       	=   drop_path_rate
       UpperCamelCase	:					List[str]       	=   image_size
       UpperCamelCase	:					List[str]       	=   ["stem"] + [F"""stage{idx}""" for idx in range(1       ,							len(self.depths   ) + 1   )]
       UpperCamelCase	,    UpperCamelCase	:					str       	=   get_aligned_output_features_output_indices(
           out_features=A_       ,							out_indices=A_       ,							stage_names=self.stage_names   )







import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline



@pytest.mark.integration
def 		A_				(     )						-> List[Any]:
 with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT     ):
  with pytest.raises(_lowerCAmelCase     ):
   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 		A_				(     )						-> Tuple:
 with offline(OfflineSimulationMode.CONNECTION_FAILS     ):
  with pytest.raises(requests.exceptions.ConnectionError     ):
   requests.request("GET"							,   "https://huggingface.co"     )



def 		A_				(     )						-> Optional[int]:
 with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1     ):
  with pytest.raises(_lowerCAmelCase     ):
   http_head("https://huggingface.co"     )
