'''simple docstring'''




def 						__snake_case (       lowerCAmelCase       :     str      ,  lowerCAmelCase       :     int			):
	print('\nVertex Distance'			)
	for i in range(_A			):
		if dist[i] != float('inf'			):
			print(_A      ,  '\t'      ,  int(dist[i]			)      ,  end='\t'			)
		else:
			print(_A      ,  '\t'      ,  'INF'      ,  end='\t'			)
		print()



def 						__snake_case (       lowerCAmelCase       :     Dict      ,  lowerCAmelCase       :     Optional[int]      ,  lowerCAmelCase       :     List[str]			):
	__UpperCAmelCase         =					float('inf'			)
	__UpperCAmelCase         =					-1
	for i in range(_A			):
		if (not vset[i]) and mdist[i] < min_val:
			__UpperCAmelCase         =					i
			__UpperCAmelCase         =					mdist[i]
	return min_ind



def 						__snake_case (       lowerCAmelCase       :     Union[str, Any]      ,  lowerCAmelCase       :     Union[str, Any]      ,  lowerCAmelCase       :     List[str]			):
	__UpperCAmelCase         =					[float('inf'			) for _ in range(_A			)]
	__UpperCAmelCase         =					[False for _ in range(_A			)]
	__UpperCAmelCase         =					0.0

	for _ in range(v - 1			):
		__UpperCAmelCase         =					min_dist(_A      ,  _A      ,  _A			)
		__UpperCAmelCase         =					True

		for i in range(_A			):
			if (
			    (not vset[i])
			    and graph[u][i] != float('inf'			)
			    and mdist[u] + graph[u][i] < mdist[i]
			):
				__UpperCAmelCase         =					mdist[u] + graph[u][i]

	print_dist(_A      ,  _A			)


if __name__ == "__main__":
					_UpperCamelCase				:		Optional[Any]       			=		int(input('Enter number of vertices: ').strip())
					_UpperCamelCase				:		str       			=		int(input('Enter number of edges: ').strip())

					_UpperCamelCase				:		List[Any]       			=		[[float('inf') for i in range(V)] for j in range(V)]

					for i in range(V):
										_UpperCamelCase				:		Optional[Any]       			=		0.0

					for i in range(E):
										print('\nEdge ', i + 1)
										_UpperCamelCase				:		str       			=		int(input('Enter source:').strip())
										_UpperCamelCase				:		Optional[int]       			=		int(input('Enter destination:').strip())
										_UpperCamelCase				:		Any       			=		float(input('Enter weight:').strip())
										_UpperCamelCase				:		Tuple       			=		weight

					_UpperCamelCase				:		Dict       			=		int(input('\nEnter shortest path source:').strip())
					dijkstra(graph, V, gsrc)




'''simple docstring'''




import json
from typing import List, Optional, Tuple

from tokenizers import pre_tokenizers, processors

from ...tokenization_utils_base import AddedToken, BatchEncoding
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_longformer import LongformerTokenizer


_UpperCamelCase				:		int       			=		logging.get_logger(__name__)

_UpperCamelCase				:		Tuple       			=		{'vocab_file': 'vocab.json', 'merges_file': 'merges.txt', 'tokenizer_file': 'tokenizer.json'}

_UpperCamelCase				:		int       			=		{
    'vocab_file': {
        'allenai/longformer-base-4096': 'https://huggingface.co/allenai/longformer-base-4096/resolve/main/vocab.json',
        'allenai/longformer-large-4096': (
            'https://huggingface.co/allenai/longformer-large-4096/resolve/main/vocab.json'
        ),
        'allenai/longformer-large-4096-finetuned-triviaqa': (
            'https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/vocab.json'
        ),
        'allenai/longformer-base-4096-extra.pos.embd.only': (
            'https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/vocab.json'
        ),
        'allenai/longformer-large-4096-extra.pos.embd.only': (
            'https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/vocab.json'
        ),
    },
    'merges_file': {
        'allenai/longformer-base-4096': 'https://huggingface.co/allenai/longformer-base-4096/resolve/main/merges.txt',
        'allenai/longformer-large-4096': (
            'https://huggingface.co/allenai/longformer-large-4096/resolve/main/merges.txt'
        ),
        'allenai/longformer-large-4096-finetuned-triviaqa': (
            'https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/merges.txt'
        ),
        'allenai/longformer-base-4096-extra.pos.embd.only': (
            'https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/merges.txt'
        ),
        'allenai/longformer-large-4096-extra.pos.embd.only': (
            'https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/merges.txt'
        ),
    },
    'tokenizer_file': {
        'allenai/longformer-base-4096': (
            'https://huggingface.co/allenai/longformer-base-4096/resolve/main/tokenizer.json'
        ),
        'allenai/longformer-large-4096': (
            'https://huggingface.co/allenai/longformer-large-4096/resolve/main/tokenizer.json'
        ),
        'allenai/longformer-large-4096-finetuned-triviaqa': (
            'https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/tokenizer.json'
        ),
        'allenai/longformer-base-4096-extra.pos.embd.only': (
            'https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/tokenizer.json'
        ),
        'allenai/longformer-large-4096-extra.pos.embd.only': (
            'https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/tokenizer.json'
        ),
    },
}

_UpperCamelCase				:		List[str]       			=		{
    'allenai/longformer-base-4096': 40_96,
    'allenai/longformer-large-4096': 40_96,
    'allenai/longformer-large-4096-finetuned-triviaqa': 40_96,
    'allenai/longformer-base-4096-extra.pos.embd.only': 40_96,
    'allenai/longformer-large-4096-extra.pos.embd.only': 40_96,
}

class   _lowercase(     _lowerCamelCase				):



   """simple docstring"""





   __lowerCamelCase    =  VOCAB_FILES_NAMES
   __lowerCamelCase    =  PRETRAINED_VOCAB_FILES_MAP
   __lowerCamelCase    =  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   __lowerCamelCase    =  ['''input_ids''', '''attention_mask''']
   __lowerCamelCase    =  LongformerTokenizer





   def __init__(							self:    Any			,a:    Optional[int]=None			,a:    Optional[int]=None			,a:    int=None			,a:    Any="replace"			,a:    Optional[int]="<s>"			,a:    Any="</s>"			,a:    Optional[int]="</s>"			,a:    Dict="<s>"			,a:    Dict="<unk>"			,a:    int="<pad>"			,a:    List[str]="<mask>"			,a:    Union[str, Any]=False			,a:    Any=True			,**a:    str			,):
    super().__init__(
        a			,a			,tokenizer_file=a			,errors=a			,bos_token=a			,eos_token=a			,sep_token=a			,cls_token=a			,unk_token=a			,pad_token=a			,mask_token=a			,add_prefix_space=a			,trim_offsets=a			,**a			,)

    __UpperCAmelCase         =					json.loads(self.backend_tokenizer.pre_tokenizer.__getstate__()	)
    if pre_tok_state.get('add_prefix_space'			,a	) != add_prefix_space:
     __UpperCAmelCase         =					getattr(a			,pre_tok_state.pop('type'	)	)
     __UpperCAmelCase         =					add_prefix_space
     __UpperCAmelCase         =					pre_tok_class(**a	)

    __UpperCAmelCase         =					add_prefix_space

    __UpperCAmelCase         =					'post_processor'
    __UpperCAmelCase         =					getattr(self.backend_tokenizer			,a			,a	)
    if tokenizer_component_instance:
     __UpperCAmelCase         =					json.loads(tokenizer_component_instance.__getstate__()	)

     # The lists 'sep' and 'cls' must be cased in tuples for the object `post_processor_class`
     if "sep" in state:
      __UpperCAmelCase         =					tuple(state['sep']	)
     if "cls" in state:
      __UpperCAmelCase         =					tuple(state['cls']	)

     __UpperCAmelCase         =					False

     if state.get('add_prefix_space'			,a	) != add_prefix_space:
      __UpperCAmelCase         =					add_prefix_space
      __UpperCAmelCase         =					True

     if state.get('trim_offsets'			,a	) != trim_offsets:
      __UpperCAmelCase         =					trim_offsets
      __UpperCAmelCase         =					True

     if changes_to_apply:
      __UpperCAmelCase         =					getattr(a			,state.pop('type'	)	)
      __UpperCAmelCase         =					component_class(**a	)
      setattr(self.backend_tokenizer			,a			,a	)





   @property
   def 			snake_case	(							self:    List[Any]	):
    if self._mask_token is None:
     if self.verbose:
      logger.error('Using mask_token, but it is not set yet.'	)
     return None
    return str(self._mask_token	)





   @mask_token.setter
   def 			snake_case	(							self:    int			,a:    Optional[int]	):
    __UpperCAmelCase         =					AddedToken(a			,lstrip=a			,rstrip=a	) if isinstance(a			,a	) else value
    __UpperCAmelCase         =					value





   def 			snake_case	(							self:    Optional[int]			,*a:    Dict			,**a:    Dict	):
    __UpperCAmelCase         =					kwargs.get('is_split_into_words'			,a	)
    assert self.add_prefix_space or not is_split_into_words, (
        f"""You need to instantiate {self.__class__.__name__} with add_prefix_space=True """
        "to use it with pretokenized inputs."
    )

    return super()._batch_encode_plus(*a			,**a	)





   def 			snake_case	(							self:    str			,*a:    Dict			,**a:    str	):
    __UpperCAmelCase         =					kwargs.get('is_split_into_words'			,a	)

    assert self.add_prefix_space or not is_split_into_words, (
        f"""You need to instantiate {self.__class__.__name__} with add_prefix_space=True """
        "to use it with pretokenized inputs."
    )

    return super()._encode_plus(*a			,**a	)





   def 			snake_case	(							self:    List[str]			,a:    str			,a:    Optional[str] = None	):
    __UpperCAmelCase         =					self._tokenizer.model.save(a			,name=a	)
    return tuple(a	)





   def 			snake_case	(							self:    Tuple			,a:    Dict			,a:    Tuple=None	):
    __UpperCAmelCase         =					[self.bos_token_id] + token_ids_a + [self.eos_token_id]
    if token_ids_a is None:
     return output

    return output + [self.eos_token_id] + token_ids_a + [self.eos_token_id]





   def 			snake_case	(							self:    int			,a:    List[int]			,a:    Optional[List[int]] = None	):
    __UpperCAmelCase         =					[self.sep_token_id]
    __UpperCAmelCase         =					[self.cls_token_id]

    if token_ids_a is None:
     return len(cls + token_ids_a + sep	) * [0]
    return len(cls + token_ids_a + sep + sep + token_ids_a + sep	) * [0]



