

import random



def       __lowerCAmelCase      (						A       ,     A       ,     A = False    ):
	UpperCAmelCase_       				=			{i: [] for i in range(A    )}

	# if probability is greater or equal than 1, then generate a complete graph
	if probability >= 1:
		return complete_graph(A    )
	# if probability is lower or equal than 0, then return a graph without edges
	if probability <= 0:
		return graph

	# for each couple of nodes, add an edge from u to v
	# if the number randomly generated is greater than probability probability
	for i in range(A    ):
		for j in range(i + 1       ,     A    ):
			if random.random() < probability:
				graph[i].append(A    )
				if not directed:
					# if the graph is undirected, add an edge in from j to i, either
					graph[j].append(A    )
	return graph



def       __lowerCAmelCase      (						A    ):
	return {
	    i: [j for j in range(A    ) if i != j] for i in range(A    )
	}


if __name__ == "__main__":
				import doctest

				doctest.testmod()







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


_a:    List[str] 							=			logging.get_logger(__name__)

_a:    Any 							=			{
    """sayakpaul/vit-msn-base""": """https://huggingface.co/sayakpaul/vit-msn-base/resolve/main/config.json""",
    # See all ViT MSN models at https://huggingface.co/models?filter=vit_msn
}

class 						__UpperCamelCase    (					lowercase						):
	SCREAMING_SNAKE_CASE__    				=     'vit_msn'




	def __init__(		self	:						Union[str, Any]		,	lowerCAmelCase	:						Optional[int]=768		,	lowerCAmelCase	:						Dict=12		,	lowerCAmelCase	:						str=12		,	lowerCAmelCase	:						List[str]=3_072		,	lowerCAmelCase	:						Tuple="gelu"		,	lowerCAmelCase	:						int=0.0		,	lowerCAmelCase	:						Optional[int]=0.0		,	lowerCAmelCase	:						Union[str, Any]=0.02		,	lowerCAmelCase	:						str=1e-06		,	lowerCAmelCase	:						Dict=224		,	lowerCAmelCase	:						str=16		,	lowerCAmelCase	:						List[Any]=3		,	lowerCAmelCase	:						Union[str, Any]=True		,	**lowerCAmelCase	:						List[str]		,	):


		'''simple docstring'''







		super().__init__(**lowerCAmelCase							)

		UpperCAmelCase_       				=			hidden_size
		UpperCAmelCase_       				=			num_hidden_layers
		UpperCAmelCase_       				=			num_attention_heads
		UpperCAmelCase_       				=			intermediate_size
		UpperCAmelCase_       				=			hidden_act
		UpperCAmelCase_       				=			hidden_dropout_prob
		UpperCAmelCase_       				=			attention_probs_dropout_prob
		UpperCAmelCase_       				=			initializer_range
		UpperCAmelCase_       				=			layer_norm_eps
		UpperCAmelCase_       				=			image_size
		UpperCAmelCase_       				=			patch_size
		UpperCAmelCase_       				=			num_channels
		UpperCAmelCase_       				=			qkv_bias