
def 				UpperCAmelCase_						(				__SCREAMING_SNAKE_CASE				):
	lowercase	    =       set()
	# To detect a back edge, keep track of vertices currently in the recursion stack
	lowercase	    =       set()
	return any(
	    node not in visited and depth_first_search(__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE				)
	    for node in graph				)






def 				UpperCAmelCase_						(				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE				):
	visited.add(__SCREAMING_SNAKE_CASE				)
	rec_stk.add(__SCREAMING_SNAKE_CASE				)

	for node in graph[vertex]:
		if node not in visited:
			if depth_first_search(__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE				):
				return True
		elif node in rec_stk:
			return True

    # The node needs to be removed from recursion stack before function ends
	rec_stk.remove(__SCREAMING_SNAKE_CASE				)
	return False


if __name__ == "__main__":
	from doctest import testmod

	testmod()








"""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


a_					=     logging.get_logger(__name__)

a_					=     {
    """sail/poolformer_s12""": """https://huggingface.co/sail/poolformer_s12/resolve/main/config.json""",
    # See all PoolFormer models at https://huggingface.co/models?filter=poolformer
}






class 						__snake_case   (						SCREAMING_SNAKE_CASE__	):





 """simple docstring"""


 _lowerCamelCase								=	"""poolformer"""

 def __init__(       self   ,		__lowerCamelCase=3   ,		__lowerCamelCase=16   ,		__lowerCamelCase=16   ,		__lowerCamelCase=3   ,		__lowerCamelCase=4.0   ,		__lowerCamelCase=[2, 2, 6, 2]   ,		__lowerCamelCase=[64, 128, 320, 512]   ,		__lowerCamelCase=[7, 3, 3, 3]   ,		__lowerCamelCase=[4, 2, 2, 2]   ,		__lowerCamelCase=[2, 1, 1, 1]   ,		__lowerCamelCase=4   ,		__lowerCamelCase=0.0   ,		__lowerCamelCase="gelu"   ,		__lowerCamelCase=True   ,		__lowerCamelCase=1e-5   ,		__lowerCamelCase=0.0_2   ,		**__lowerCamelCase   ,		):



     '''simple docstring'''




     __A       :		str							=	num_channels
     __A       :		List[str]							=	patch_size
     __A       :		str							=	stride
     __A       :		Any							=	padding
     __A       :		Any							=	pool_size
     __A       :		Dict							=	hidden_sizes
     __A       :		Optional[Any]							=	mlp_ratio
     __A       :		Any							=	depths
     __A       :		List[str]							=	patch_sizes
     __A       :		Union[str, Any]							=	strides
     __A       :		List[str]							=	num_encoder_blocks
     __A       :		Optional[int]							=	drop_path_rate
     __A       :		Union[str, Any]							=	hidden_act
     __A       :		Optional[Any]							=	use_layer_scale
     __A       :		List[Any]							=	layer_scale_init_value
     __A       :		List[Any]							=	initializer_range
     super().__init__(**__lowerCamelCase    )






class 						__snake_case   (						SCREAMING_SNAKE_CASE__	):





 """simple docstring"""


 _lowerCamelCase								=	version.parse("""1.11"""	)

 @property
 def    UpperCamelCase__(       self    ):



     '''simple docstring'''




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







 @property
 def    UpperCamelCase__(       self    ):



     '''simple docstring'''




     return 2e-3




