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


UpperCamelCase__      :		Optional[Any]       							=  logging.get_logger(__name__)

UpperCamelCase__      :		Union[str, Any]       							=  {
    "unc-nlp/lxmert-base-uncased": "https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json",
}

class    _a				(__lowerCamelCase):





       """simple docstring"""




       SCREAMING_SNAKE_CASE      =  '''lxmert'''
       SCREAMING_SNAKE_CASE      =  {}






       def __init__(							self       ,							A__=3_05_22       ,							A__=7_68       ,							A__=12       ,							A__=95_00       ,							A__=16_00       ,							A__=4_00       ,							A__=30_72       ,							A__="gelu"       ,							A__=0.1       ,							A__=0.1       ,							A__=5_12       ,							A__=2       ,							A__=0.02       ,							A__=1E-12       ,							A__=9       ,							A__=5       ,							A__=5       ,							A__=20_48       ,							A__=4       ,							A__=6.67       ,							A__=True       ,							A__=True       ,							A__=True       ,							A__=True       ,							A__=True       ,							A__=True       ,							A__=True       ,							**A__       ,							)    ->			List[Any]:
          _SCREAMING_SNAKE_CASE      =				vocab_size
          _SCREAMING_SNAKE_CASE      =				hidden_size
          _SCREAMING_SNAKE_CASE      =				num_attention_heads
          _SCREAMING_SNAKE_CASE      =				hidden_act
          _SCREAMING_SNAKE_CASE      =				intermediate_size
          _SCREAMING_SNAKE_CASE      =				hidden_dropout_prob
          _SCREAMING_SNAKE_CASE      =				attention_probs_dropout_prob
          _SCREAMING_SNAKE_CASE      =				max_position_embeddings
          _SCREAMING_SNAKE_CASE      =				type_vocab_size
          _SCREAMING_SNAKE_CASE      =				initializer_range
          _SCREAMING_SNAKE_CASE      =				layer_norm_eps
          _SCREAMING_SNAKE_CASE      =				num_qa_labels
          _SCREAMING_SNAKE_CASE      =				num_object_labels
          _SCREAMING_SNAKE_CASE      =				num_attr_labels
          _SCREAMING_SNAKE_CASE      =				l_layers
          _SCREAMING_SNAKE_CASE      =				x_layers
          _SCREAMING_SNAKE_CASE      =				r_layers
          _SCREAMING_SNAKE_CASE      =				visual_feat_dim
          _SCREAMING_SNAKE_CASE      =				visual_pos_dim
          _SCREAMING_SNAKE_CASE      =				visual_loss_normalizer
          _SCREAMING_SNAKE_CASE      =				task_matched
          _SCREAMING_SNAKE_CASE      =				task_mask_lm
          _SCREAMING_SNAKE_CASE      =				task_obj_predict
          _SCREAMING_SNAKE_CASE      =				task_qa
          _SCREAMING_SNAKE_CASE      =				visual_obj_loss
          _SCREAMING_SNAKE_CASE      =				visual_attr_loss
          _SCREAMING_SNAKE_CASE      =				visual_feat_loss
          _SCREAMING_SNAKE_CASE      =				{"vision": r_layers, "cross_encoder": x_layers, "language": l_layers}
          super().__init__(**a_      )








'''simple docstring'''



from __future__ import annotations
def    lowerCAmelCase_	(				SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_						)     ->     Tuple:




   """simple docstring"""
   print(F"Vertex\tShortest Distance from vertex {src}"						)
   for i, d in enumerate(SCREAMING_SNAKE_CASE_						):
      print(F"{i}\t\t{d}"						)
def    lowerCAmelCase_	(				SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_						)     ->     List[Any]:




   """simple docstring"""
   for j in range(SCREAMING_SNAKE_CASE_						):
      _SCREAMING_SNAKE_CASE ,							_SCREAMING_SNAKE_CASE ,							_SCREAMING_SNAKE_CASE      =				(graph[j][k] for k in ["""src""", """dst""", """weight"""])
      if distance[u] != float("""inf"""						) and distance[u] + w < distance[v]:
         return True
   return False
def    lowerCAmelCase_	(				SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_						)     ->     list[float]:




   """simple docstring"""
   _SCREAMING_SNAKE_CASE      =				[float("""inf"""						)] * vertex_count
   _SCREAMING_SNAKE_CASE      =				0.0

   for _ in range(vertex_count - 1						):
      for j in range(SCREAMING_SNAKE_CASE_						):
         _SCREAMING_SNAKE_CASE ,							_SCREAMING_SNAKE_CASE ,							_SCREAMING_SNAKE_CASE      =				(graph[j][k] for k in ["""src""", """dst""", """weight"""])

         if distance[u] != float("""inf"""						) and distance[u] + w < distance[v]:
            _SCREAMING_SNAKE_CASE      =				distance[u] + w

   _SCREAMING_SNAKE_CASE      =				check_negative_cycle(SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_    ,      SCREAMING_SNAKE_CASE_						)
   if negative_cycle_exists:
      raise Exception("""Negative cycle found"""						)

   return distance


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     UpperCamelCase__      :		int       							=  int(input("Enter number of vertices: ").strip())
     UpperCamelCase__      :		int       							=  int(input("Enter number of edges: ").strip())

     UpperCamelCase__      :		list[dict[str, int]]       							=  [{} for _ in range(E)]

     for i in range(E):
          print("Edge ", i + 1)
          UpperCamelCase__							,      UpperCamelCase__							,      UpperCamelCase__      :		Dict       							=  (
              int(x)
              for x in input("Enter source, destination, weight: ").strip().split(" ")
          )
          UpperCamelCase__      :		Optional[Any]       							=  {"src": src, "dst": dest, "weight": weight}

     UpperCamelCase__      :		Optional[Any]       							=  int(input("\nEnter shortest path source:").strip())
     UpperCamelCase__      :		Any       							=  bellman_ford(graph, V, E, source)
     print_distance(shortest_distance, 0)






