

"""simple docstring"""






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


snake_case_   :   Any        =       logging.get_logger(__name__)

snake_case_   :   Any        =       {
    """google/vivit-b-16x2-kinetics400""": (
        """https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json"""
    ),
    # See all Vivit models at https://huggingface.co/models?filter=vivit
}







class       snake_case__  ( lowerCAmelCase_     ):
			SCREAMING_SNAKE_CASE__     				=						'''vivit'''







			def __init__(			self			: Any			,  lowercase			: Optional[Any]=2_24			,  lowercase			: Union[str, Any]=32			,  lowercase			: Optional[int]=[2, 16, 16]			,  lowercase			: Union[str, Any]=3			,  lowercase			: Any=7_68			,  lowercase			: Tuple=12			,  lowercase			: Tuple=12			,  lowercase			: Any=30_72			,  lowercase			: Union[str, Any]="gelu_fast"			,  lowercase			: List[Any]=0.0			,  lowercase			: Any=0.0			,  lowercase			: Optional[int]=0.0_2			,  lowercase			: Optional[int]=1E-06			,  lowercase			: Optional[Any]=True			,  **lowercase			: Any			,  ):





								'''simple docstring'''



								UpperCAmelCase			:   Union[str, Any]      =				hidden_size
								UpperCAmelCase			:   Optional[int]      =				num_hidden_layers
								UpperCAmelCase			:   Dict      =				num_attention_heads
								UpperCAmelCase			:   List[str]      =				intermediate_size
								UpperCAmelCase			:   Dict      =				hidden_act
								UpperCAmelCase			:   Union[str, Any]      =				hidden_dropout_prob
								UpperCAmelCase			:   List[str]      =				attention_probs_dropout_prob
								UpperCAmelCase			:   Tuple      =				initializer_range
								UpperCAmelCase			:   Any      =				layer_norm_eps

								UpperCAmelCase			:   List[Any]      =				image_size
								UpperCAmelCase			:   str      =				num_frames
								UpperCAmelCase			:   int      =				tubelet_size
								UpperCAmelCase			:   int      =				num_channels
								UpperCAmelCase			:   Any      =				qkv_bias

								super().__init__(**lowercase  )





"""simple docstring"""






from __future__ import annotations

from collections import Counter
from random import random







class       snake_case__  :







			def __init__(			self			: Any  ):





								'''simple docstring'''



								UpperCAmelCase			:   List[Any]      =				{}







			def 			__lowerCAmelCase				(			self			: List[Any]			,  lowercase			: str  ):





								'''simple docstring'''



								UpperCAmelCase			:   Optional[int]      =				{}







			def 			__lowerCAmelCase				(			self			: Optional[int]			,  lowercase			: str			,  lowercase			: str			,  lowercase			: float  ):





								'''simple docstring'''



								if nodea not in self.connections:
													self.add_node(lowercase  )
								if nodea not in self.connections:
													self.add_node(lowercase  )
								UpperCAmelCase			:   int      =				probability







			def 			__lowerCAmelCase				(			self			: List[Any]  ):





								'''simple docstring'''



								return list(self.connections  )







			def 			__lowerCAmelCase				(			self			: int			,  lowercase			: str  ):





								'''simple docstring'''



								UpperCAmelCase			:   int      =				0
								UpperCAmelCase			:   Union[str, Any]      =				random()

								for dest in self.connections[node]:
													current_probability += self.connections[node][dest]
													if current_probability > random_value:
																		return dest
								return ""



def   lowercase_	(    _lowercase       :		str							,      _lowercase       :		list[tuple[str, str, float]]							,      _lowercase       :		int	):




					'''simple docstring'''






					UpperCAmelCase			:   int      =				MarkovChainGraphUndirectedUnweighted()

					for nodea, nodea, probability in transitions:
										graph.add_transition_probability(_lowercase							,      _lowercase							,      _lowercase	)

					UpperCAmelCase			:   List[Any]      =				Counter(graph.get_nodes()	)
					UpperCAmelCase			:   List[Any]      =				start

					for _ in range(_lowercase	):
										UpperCAmelCase			:   Optional[Any]      =				graph.transition(_lowercase	)
										visited[node] += 1

					return visited


if __name__ == "__main__":
	import doctest

	doctest.testmod()


