'''simple docstring'''






import heapq as hq
import math
from collections.abc import Iterator




class    a :



  """simple docstring"""







  def __init__(							self   ,    snake_case_					):

    '''simple docstring'''







    __UpperCAmelCase:					str		= str(id_					)
    __UpperCAmelCase:					Dict		= None
    __UpperCAmelCase:					List[str]		= None
    __UpperCAmelCase:					List[str]		= []
    __UpperCAmelCase:					Any		= {}  # {vertex:distance}







  def __lt__(							self   ,    snake_case_					):

    '''simple docstring'''







    return self.key < other.key







  def __repr__(							self					):

    '''simple docstring'''







    return self.id







  def    lowercase_  (							self   ,    snake_case_					):

    '''simple docstring'''







    self.neighbors.append(snake_case_					)







  def    lowercase_  (							self   ,    snake_case_   ,    snake_case_					):

    '''simple docstring'''







    __UpperCAmelCase:					str		= weight






def  UpperCamelCase__					(					_lowercase    :				Any   ,    _lowercase    :				List[Any]   ,    _lowercase    :				Any   ,    _lowercase    :				Optional[Any]     )							->	int:
  # add the neighbors:
  graph[a - 1].add_neighbor(graph[b - 1]     )
  graph[b - 1].add_neighbor(graph[a - 1]     )
  # add the edges:
  graph[a - 1].add_edge(graph[b - 1]   ,    _lowercase     )
  graph[b - 1].add_edge(graph[a - 1]   ,    _lowercase     )






def  UpperCamelCase__					(					_lowercase    :				list   ,    _lowercase    :				Vertex     )							->	list:
  __UpperCAmelCase:					int		= []
  for u in graph:
    __UpperCAmelCase:					int		= math.inf
    __UpperCAmelCase:					List[Any]		= None
  __UpperCAmelCase:					List[Any]		= 0
  __UpperCAmelCase:					Optional[Any]		= graph[:]
  while q:
    __UpperCAmelCase:					Dict		= min(_lowercase     )
    q.remove(_lowercase     )
    for v in u.neighbors:
      if (v in q) and (u.edges[v.id] < v.key):
        __UpperCAmelCase:					Any		= u
        __UpperCAmelCase:					Union[str, Any]		= u.edges[v.id]
  for i in range(1   ,    len(_lowercase     )     ):
    a.append((int(graph[i].id     ) + 1, int(graph[i].pi.id     ) + 1)     )
  return a






def  UpperCamelCase__					(					_lowercase    :				list   ,    _lowercase    :				Vertex     )							->	Iterator[tuple]:
  for u in graph:
    __UpperCAmelCase:					List[Any]		= math.inf
    __UpperCAmelCase:					List[str]		= None
  __UpperCAmelCase:					Any		= 0

  __UpperCAmelCase:					Optional[Any]		= list(_lowercase     )
  hq.heapify(_lowercase     )

  while h:
    __UpperCAmelCase:					str		= hq.heappop(_lowercase     )
    for v in u.neighbors:
      if (v in h) and (u.edges[v.id] < v.key):
        __UpperCAmelCase:					Union[str, Any]		= u
        __UpperCAmelCase:					Optional[int]		= u.edges[v.id]
        hq.heapify(_lowercase     )

  for i in range(1   ,    len(_lowercase     )     ):
    yield (int(graph[i].id     ) + 1, int(graph[i].pi.id     ) + 1)






def  UpperCamelCase__					(					)							->	None:
  pass


if __name__ == "__main__":
    import doctest

    doctest.testmod()
'''simple docstring'''






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


SCREAMING_SNAKE_CASE_	   =			logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_	   =			{
    'facebook/timesformer': 'https://huggingface.co/facebook/timesformer/resolve/main/config.json',
}




class    a (       __lowerCAmelCase				):



  """simple docstring"""
  __lowerCAmelCase				      =					"""timesformer"""







  def __init__(							self   ,    snake_case_=224   ,    snake_case_=16   ,    snake_case_=3   ,    snake_case_=8   ,    snake_case_=768   ,    snake_case_=12   ,    snake_case_=12   ,    snake_case_=3072   ,    snake_case_="gelu"   ,    snake_case_=0.0   ,    snake_case_=0.0   ,    snake_case_=0.0_2   ,    snake_case_=1e-6   ,    snake_case_=True   ,    snake_case_="divided_space_time"   ,    snake_case_=0   ,    **snake_case_   ,    ):

    '''simple docstring'''







    super().__init__(**snake_case_					)

    __UpperCAmelCase:					Tuple		= image_size
    __UpperCAmelCase:					List[Any]		= patch_size
    __UpperCAmelCase:					Optional[Any]		= num_channels
    __UpperCAmelCase:					int		= num_frames

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

    __UpperCAmelCase:					str		= attention_type
    __UpperCAmelCase:					Tuple		= drop_path_rate