





'''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_roberta import RobertaTokenizer


lowercase__		:     Dict			=							logging.get_logger(__name__)

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

lowercase__		:     List[str]			=							{
    'vocab_file': {
        'roberta-base': 'https://huggingface.co/roberta-base/resolve/main/vocab.json',
        'roberta-large': 'https://huggingface.co/roberta-large/resolve/main/vocab.json',
        'roberta-large-mnli': 'https://huggingface.co/roberta-large-mnli/resolve/main/vocab.json',
        'distilroberta-base': 'https://huggingface.co/distilroberta-base/resolve/main/vocab.json',
        'roberta-base-openai-detector': 'https://huggingface.co/roberta-base-openai-detector/resolve/main/vocab.json',
        'roberta-large-openai-detector': (
            'https://huggingface.co/roberta-large-openai-detector/resolve/main/vocab.json'
        ),
    },
    'merges_file': {
        'roberta-base': 'https://huggingface.co/roberta-base/resolve/main/merges.txt',
        'roberta-large': 'https://huggingface.co/roberta-large/resolve/main/merges.txt',
        'roberta-large-mnli': 'https://huggingface.co/roberta-large-mnli/resolve/main/merges.txt',
        'distilroberta-base': 'https://huggingface.co/distilroberta-base/resolve/main/merges.txt',
        'roberta-base-openai-detector': 'https://huggingface.co/roberta-base-openai-detector/resolve/main/merges.txt',
        'roberta-large-openai-detector': (
            'https://huggingface.co/roberta-large-openai-detector/resolve/main/merges.txt'
        ),
    },
    'tokenizer_file': {
        'roberta-base': 'https://huggingface.co/roberta-base/resolve/main/tokenizer.json',
        'roberta-large': 'https://huggingface.co/roberta-large/resolve/main/tokenizer.json',
        'roberta-large-mnli': 'https://huggingface.co/roberta-large-mnli/resolve/main/tokenizer.json',
        'distilroberta-base': 'https://huggingface.co/distilroberta-base/resolve/main/tokenizer.json',
        'roberta-base-openai-detector': (
            'https://huggingface.co/roberta-base-openai-detector/resolve/main/tokenizer.json'
        ),
        'roberta-large-openai-detector': (
            'https://huggingface.co/roberta-large-openai-detector/resolve/main/tokenizer.json'
        ),
    },
}

lowercase__		:     Tuple			=							{
    'roberta-base': 5_12,
    'roberta-large': 5_12,
    'roberta-large-mnli': 5_12,
    'distilroberta-base': 5_12,
    'roberta-base-openai-detector': 5_12,
    'roberta-large-openai-detector': 5_12,
}
class 							__lowerCAmelCase	(       __magic_name__					):






       """simple docstring"""
       _snake_case      :	Optional[int]									=       VOCAB_FILES_NAMES
       _snake_case      :	Any									=       PRETRAINED_VOCAB_FILES_MAP
       _snake_case      :	Tuple									=       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       _snake_case      :	Dict									=       ['input_ids', 'attention_mask']
       _snake_case      :	Any									=       RobertaTokenizer





       def __init__(				self  :						List[Any]			,					lowerCAmelCase__  :						Tuple=None			,					lowerCAmelCase__  :						Tuple=None			,					lowerCAmelCase__  :						Any=None			,					lowerCAmelCase__  :						List[Any]="replace"			,					lowerCAmelCase__  :						int="<s>"			,					lowerCAmelCase__  :						List[str]="</s>"			,					lowerCAmelCase__  :						Dict="</s>"			,					lowerCAmelCase__  :						List[Any]="<s>"			,					lowerCAmelCase__  :						List[Any]="<unk>"			,					lowerCAmelCase__  :						List[Any]="<pad>"			,					lowerCAmelCase__  :						Optional[Any]="<mask>"			,					lowerCAmelCase__  :						int=False			,					lowerCAmelCase__  :						Optional[int]=True			,					**lowerCAmelCase__  :						Tuple			,					)       ->	Dict:

            '''simple docstring'''




            super().__init__(
                lowerCAmelCase__			,					lowerCAmelCase__			,					tokenizer_file=lowerCAmelCase__			,					errors=lowerCAmelCase__			,					bos_token=lowerCAmelCase__			,					eos_token=lowerCAmelCase__			,					sep_token=lowerCAmelCase__			,					cls_token=lowerCAmelCase__			,					unk_token=lowerCAmelCase__			,					pad_token=lowerCAmelCase__			,					mask_token=lowerCAmelCase__			,					add_prefix_space=lowerCAmelCase__			,					trim_offsets=lowerCAmelCase__			,					**lowerCAmelCase__			,					)

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

            _UpperCamelCase							       =			add_prefix_space

            _UpperCamelCase							       =			'''post_processor'''
            _UpperCamelCase							       =			getattr(self.backend_tokenizer			,					lowerCAmelCase__			,					lowerCAmelCase__	)
            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'''			,					lowerCAmelCase__	) != add_prefix_space:
                      _UpperCamelCase							       =			add_prefix_space
                      _UpperCamelCase							       =			True

                 if state.get('''trim_offsets'''			,					lowerCAmelCase__	) != trim_offsets:
                      _UpperCamelCase							       =			trim_offsets
                      _UpperCamelCase							       =			True

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





       @property
       def snake_case__		(				self  :						Optional[int]	)       ->	str:

            '''simple docstring'''




            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  :						str			,					lowerCAmelCase__  :						Dict	)       ->	Optional[Any]:

            '''simple docstring'''




            _UpperCamelCase							       =			AddedToken(lowerCAmelCase__			,					lstrip=lowerCAmelCase__			,					rstrip=lowerCAmelCase__	) if isinstance(lowerCAmelCase__			,					lowerCAmelCase__	) else value
            _UpperCamelCase							       =			value





       def snake_case__		(				self  :						Dict			,					*lowerCAmelCase__  :						Optional[Any]			,					**lowerCAmelCase__  :						Dict	)       ->	BatchEncoding:

            '''simple docstring'''




            _UpperCamelCase							       =			kwargs.get('''is_split_into_words'''			,					lowerCAmelCase__	)
            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(*lowerCAmelCase__			,					**lowerCAmelCase__	)





       def snake_case__		(				self  :						int			,					*lowerCAmelCase__  :						Any			,					**lowerCAmelCase__  :						List[str]	)       ->	BatchEncoding:

            '''simple docstring'''




            _UpperCamelCase							       =			kwargs.get('''is_split_into_words'''			,					lowerCAmelCase__	)

            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(*lowerCAmelCase__			,					**lowerCAmelCase__	)





       def snake_case__		(				self  :						Union[str, Any]			,					lowerCAmelCase__  :						str			,					lowerCAmelCase__  :						Optional[str] = None	)       ->	Tuple[str]:

            '''simple docstring'''




            _UpperCamelCase							       =			self._tokenizer.model.save(lowerCAmelCase__			,					name=lowerCAmelCase__	)
            return tuple(lowerCAmelCase__	)





       def snake_case__		(				self  :						Optional[Any]			,					lowerCAmelCase__  :						Optional[int]			,					lowerCAmelCase__  :						Any=None	)       ->	Optional[int]:

            '''simple docstring'''




            _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  :						Dict			,					lowerCAmelCase__  :						List[int]			,					lowerCAmelCase__  :						Optional[List[int]] = None	)       ->	List[int]:

            '''simple docstring'''




            _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]






"""simple docstring"""





from collections import deque
from math import floor
from random import random
from time import time







class 							SCREAMING_SNAKE_CASE   :






					"""simple docstring"""



					def __init__(			self     :							Union[str, Any]						):
						lowerCAmelCase__      :		List[str]    							=      {}







					def 			__lowerCAmelCase					(			self     :							Optional[Any]  ,lowercase_     :							Optional[Any]  ,lowercase_     :							str  ,lowercase_     :							List[str]=1						):
						if self.graph.get(lowercase_						):
							if self.graph[u].count([w, v]						) == 0:
								self.graph[u].append([w, v]						)
						else:
							lowerCAmelCase__      :		Optional[int]    							=      [[w, v]]
						if not self.graph.get(lowercase_						):
							lowerCAmelCase__      :		Union[str, Any]    							=      []







					def 			__lowerCAmelCase					(			self     :							List[Any]						):
						return list(self.graph						)







					def 			__lowerCAmelCase					(			self     :							Dict  ,lowercase_     :							Tuple  ,lowercase_     :							Tuple						):
						if self.graph.get(lowercase_						):
							for _ in self.graph[u]:
								if _[1] == v:
									self.graph[u].remove(lowercase_						)







					def 			__lowerCAmelCase					(			self     :							int  ,lowercase_     :							Any=-2  ,lowercase_     :							List[Any]=-1						):
						if s == d:
							return []
						lowerCAmelCase__      :		int    							=      []
						lowerCAmelCase__      :		List[Any]    							=      []
						if s == -2:
							lowerCAmelCase__      :		int    							=      list(self.graph						)[0]
						stack.append(lowercase_						)
						visited.append(lowercase_						)
						lowerCAmelCase__      :		int    							=      s

						while True:
							# check if there is any non isolated nodes
							if len(self.graph[s]						) != 0:
								lowerCAmelCase__      :		List[Any]    							=      s
								for node in self.graph[s]:
									if visited.count(node[1]						) < 1:
										if node[1] == d:
											visited.append(lowercase_						)
											return visited
										else:
											stack.append(node[1]						)
											visited.append(node[1]						)
											lowerCAmelCase__      :		Optional[int]    							=      node[1]
											break

            # check if all the children are visited
							if s == ss:
								stack.pop()
								if len(lowercase_						) != 0:
									lowerCAmelCase__      :		str    							=      stack[len(lowercase_						) - 1]
							else:
								lowerCAmelCase__      :		Union[str, Any]    							=      ss

							# check if se have reached the starting point
							if len(lowercase_						) == 0:
								return visited







					def 			__lowerCAmelCase					(			self     :							Dict  ,lowercase_     :							Optional[Any]=-1						):
						if c == -1:
							lowerCAmelCase__      :		Any    							=      floor(random() * 1_0_0_0_0						) + 1_0
						for i in range(lowercase_						):
							# every vertex has max 100 edges
							for _ in range(floor(random() * 1_0_2						) + 1						):
								lowerCAmelCase__      :		Any    							=      floor(random() * c						) + 1
								if n != i:
									self.add_pair(lowercase_  ,lowercase_  ,1						)







					def 			__lowerCAmelCase					(			self     :							Optional[Any]  ,lowercase_     :							Union[str, Any]=-2						):
						lowerCAmelCase__      :		Tuple    							=      deque()
						lowerCAmelCase__      :		Tuple    							=      []
						if s == -2:
							lowerCAmelCase__      :		Any    							=      list(self.graph						)[0]
						d.append(lowercase_						)
						visited.append(lowercase_						)
						while d:
							lowerCAmelCase__      :		Dict    							=      d.popleft()
							if len(self.graph[s]						) != 0:
								for node in self.graph[s]:
									if visited.count(node[1]						) < 1:
										d.append(node[1]						)
										visited.append(node[1]						)
						return visited







					def 			__lowerCAmelCase					(			self     :							Union[str, Any]  ,lowercase_     :							Optional[Any]						):
						lowerCAmelCase__      :		Optional[Any]    							=      0
						for x in self.graph:
							for y in self.graph[x]:
								if y[1] == u:
									count += 1
						return count







					def 			__lowerCAmelCase					(			self     :							str  ,lowercase_     :							Optional[int]						):
						return len(self.graph[u]						)







					def 			__lowerCAmelCase					(			self     :							List[str]  ,lowercase_     :							List[str]=-2						):
						lowerCAmelCase__      :		Union[str, Any]    							=      []
						lowerCAmelCase__      :		Any    							=      []
						if s == -2:
							lowerCAmelCase__      :		Any    							=      list(self.graph						)[0]
						stack.append(lowercase_						)
						visited.append(lowercase_						)
						lowerCAmelCase__      :		Tuple    							=      s
						lowerCAmelCase__      :		Optional[int]    							=      []

						while True:
							# check if there is any non isolated nodes
							if len(self.graph[s]						) != 0:
								lowerCAmelCase__      :		Optional[Any]    							=      s
								for node in self.graph[s]:
									if visited.count(node[1]						) < 1:
										stack.append(node[1]						)
										visited.append(node[1]						)
										lowerCAmelCase__      :		Dict    							=      node[1]
										break

            # check if all the children are visited
							if s == ss:
								sorted_nodes.append(stack.pop()						)
								if len(lowercase_						) != 0:
									lowerCAmelCase__      :		Union[str, Any]    							=      stack[len(lowercase_						) - 1]
							else:
								lowerCAmelCase__      :		int    							=      ss

							# check if se have reached the starting point
							if len(lowercase_						) == 0:
								return sorted_nodes







					def 			__lowerCAmelCase					(			self     :							List[Any]						):
						lowerCAmelCase__      :		str    							=      []
						lowerCAmelCase__      :		List[str]    							=      []
						lowerCAmelCase__      :		int    							=      list(self.graph						)[0]
						stack.append(lowercase_						)
						visited.append(lowercase_						)
						lowerCAmelCase__      :		List[Any]    							=      -2
						lowerCAmelCase__      :		str    							=      []
						lowerCAmelCase__      :		Optional[Any]    							=      s
						lowerCAmelCase__      :		Union[str, Any]    							=      False
						lowerCAmelCase__      :		Optional[int]    							=      set()

						while True:
							# check if there is any non isolated nodes
							if len(self.graph[s]						) != 0:
								lowerCAmelCase__      :		List[str]    							=      s
								for node in self.graph[s]:
									if (
									    visited.count(node[1]						) > 0
									    and node[1] != parent
									    and indirect_parents.count(node[1]						) > 0
									    and not on_the_way_back
									):
										lowerCAmelCase__      :		List[Any]    							=      len(lowercase_						) - 1
										while len_stack >= 0:
											if stack[len_stack] == node[1]:
												anticipating_nodes.add(node[1]						)
												break
											else:
												anticipating_nodes.add(stack[len_stack]						)
												len_stack -= 1
									if visited.count(node[1]						) < 1:
										stack.append(node[1]						)
										visited.append(node[1]						)
										lowerCAmelCase__      :		Optional[int]    							=      node[1]
										break

            # check if all the children are visited
							if s == ss:
								stack.pop()
								lowerCAmelCase__      :		str    							=      True
								if len(lowercase_						) != 0:
									lowerCAmelCase__      :		Tuple    							=      stack[len(lowercase_						) - 1]
							else:
								lowerCAmelCase__      :		int    							=      False
								indirect_parents.append(lowercase_						)
								lowerCAmelCase__      :		str    							=      s
								lowerCAmelCase__      :		Tuple    							=      ss

							# check if se have reached the starting point
							if len(lowercase_						) == 0:
								return list(lowercase_						)







					def 			__lowerCAmelCase					(			self     :							int						):
						lowerCAmelCase__      :		Tuple    							=      []
						lowerCAmelCase__      :		Tuple    							=      []
						lowerCAmelCase__      :		Any    							=      list(self.graph						)[0]
						stack.append(lowercase_						)
						visited.append(lowercase_						)
						lowerCAmelCase__      :		List[str]    							=      -2
						lowerCAmelCase__      :		int    							=      []
						lowerCAmelCase__      :		int    							=      s
						lowerCAmelCase__      :		List[Any]    							=      False
						lowerCAmelCase__      :		List[str]    							=      set()

						while True:
							# check if there is any non isolated nodes
							if len(self.graph[s]						) != 0:
								lowerCAmelCase__      :		Optional[int]    							=      s
								for node in self.graph[s]:
									if (
									    visited.count(node[1]						) > 0
									    and node[1] != parent
									    and indirect_parents.count(node[1]						) > 0
									    and not on_the_way_back
									):
										lowerCAmelCase__      :		List[Any]    							=      len(lowercase_						) - 1
										while len_stack_minus_one >= 0:
											if stack[len_stack_minus_one] == node[1]:
												anticipating_nodes.add(node[1]						)
												break
											else:
												return True
									if visited.count(node[1]						) < 1:
										stack.append(node[1]						)
										visited.append(node[1]						)
										lowerCAmelCase__      :		Optional[Any]    							=      node[1]
										break

            # check if all the children are visited
							if s == ss:
								stack.pop()
								lowerCAmelCase__      :		List[str]    							=      True
								if len(lowercase_						) != 0:
									lowerCAmelCase__      :		Dict    							=      stack[len(lowercase_						) - 1]
							else:
								lowerCAmelCase__      :		Union[str, Any]    							=      False
								indirect_parents.append(lowercase_						)
								lowerCAmelCase__      :		Tuple    							=      s
								lowerCAmelCase__      :		Union[str, Any]    							=      ss

							# check if se have reached the starting point
							if len(lowercase_						) == 0:
								return False







					def 			__lowerCAmelCase					(			self     :							Any  ,lowercase_     :							List[Any]=-2  ,lowercase_     :							Union[str, Any]=-1						):
						lowerCAmelCase__      :		Optional[int]    							=      time()
						self.dfs(lowercase_  ,lowercase_						)
						lowerCAmelCase__      :		Any    							=      time()
						return end - begin







					def 			__lowerCAmelCase					(			self     :							Any  ,lowercase_     :							Dict=-2						):
						lowerCAmelCase__      :		List[str]    							=      time()
						self.bfs(lowercase_						)
						lowerCAmelCase__      :		List[Any]    							=      time()
						return end - begin







class 							SCREAMING_SNAKE_CASE   :






					"""simple docstring"""



					def __init__(			self     :							Union[str, Any]						):
						lowerCAmelCase__      :		Tuple    							=      {}







					def 			__lowerCAmelCase					(			self     :							List[Any]  ,lowercase_     :							Optional[int]  ,lowercase_     :							Dict  ,lowercase_     :							Any=1						):
						# check if the u exists
						if self.graph.get(lowercase_						):
							# if there already is a edge
							if self.graph[u].count([w, v]						) == 0:
								self.graph[u].append([w, v]						)
						else:
							# if u does not exist
							lowerCAmelCase__      :		List[Any]    							=      [[w, v]]
						# add the other way
						if self.graph.get(lowercase_						):
							# if there already is a edge
							if self.graph[v].count([w, u]						) == 0:
								self.graph[v].append([w, u]						)
						else:
							# if u does not exist
							lowerCAmelCase__      :		int    							=      [[w, u]]







					def 			__lowerCAmelCase					(			self     :							Dict  ,lowercase_     :							Union[str, Any]  ,lowercase_     :							Dict						):
						if self.graph.get(lowercase_						):
							for _ in self.graph[u]:
								if _[1] == v:
									self.graph[u].remove(lowercase_						)
        # the other way round
						if self.graph.get(lowercase_						):
							for _ in self.graph[v]:
								if _[1] == u:
									self.graph[v].remove(lowercase_						)







					def 			__lowerCAmelCase					(			self     :							int  ,lowercase_     :							Optional[int]=-2  ,lowercase_     :							str=-1						):
						if s == d:
							return []
						lowerCAmelCase__      :		Optional[Any]    							=      []
						lowerCAmelCase__      :		Any    							=      []
						if s == -2:
							lowerCAmelCase__      :		Tuple    							=      list(self.graph						)[0]
						stack.append(lowercase_						)
						visited.append(lowercase_						)
						lowerCAmelCase__      :		int    							=      s

						while True:
							# check if there is any non isolated nodes
							if len(self.graph[s]						) != 0:
								lowerCAmelCase__      :		Optional[int]    							=      s
								for node in self.graph[s]:
									if visited.count(node[1]						) < 1:
										if node[1] == d:
											visited.append(lowercase_						)
											return visited
										else:
											stack.append(node[1]						)
											visited.append(node[1]						)
											lowerCAmelCase__      :		List[str]    							=      node[1]
											break

            # check if all the children are visited
							if s == ss:
								stack.pop()
								if len(lowercase_						) != 0:
									lowerCAmelCase__      :		str    							=      stack[len(lowercase_						) - 1]
							else:
								lowerCAmelCase__      :		Dict    							=      ss

							# check if se have reached the starting point
							if len(lowercase_						) == 0:
								return visited







					def 			__lowerCAmelCase					(			self     :							Union[str, Any]  ,lowercase_     :							List[Any]=-1						):
						if c == -1:
							lowerCAmelCase__      :		str    							=      floor(random() * 1_0_0_0_0						) + 1_0
						for i in range(lowercase_						):
							# every vertex has max 100 edges
							for _ in range(floor(random() * 1_0_2						) + 1						):
								lowerCAmelCase__      :		List[str]    							=      floor(random() * c						) + 1
								if n != i:
									self.add_pair(lowercase_  ,lowercase_  ,1						)







					def 			__lowerCAmelCase					(			self     :							Optional[Any]  ,lowercase_     :							List[Any]=-2						):
						lowerCAmelCase__      :		Tuple    							=      deque()
						lowerCAmelCase__      :		List[Any]    							=      []
						if s == -2:
							lowerCAmelCase__      :		Tuple    							=      list(self.graph						)[0]
						d.append(lowercase_						)
						visited.append(lowercase_						)
						while d:
							lowerCAmelCase__      :		Any    							=      d.popleft()
							if len(self.graph[s]						) != 0:
								for node in self.graph[s]:
									if visited.count(node[1]						) < 1:
										d.append(node[1]						)
										visited.append(node[1]						)
						return visited







					def 			__lowerCAmelCase					(			self     :							Any  ,lowercase_     :							Any						):
						return len(self.graph[u]						)







					def 			__lowerCAmelCase					(			self     :							Any						):
						lowerCAmelCase__      :		List[Any]    							=      []
						lowerCAmelCase__      :		int    							=      []
						lowerCAmelCase__      :		List[Any]    							=      list(self.graph						)[0]
						stack.append(lowercase_						)
						visited.append(lowercase_						)
						lowerCAmelCase__      :		Optional[int]    							=      -2
						lowerCAmelCase__      :		List[str]    							=      []
						lowerCAmelCase__      :		Tuple    							=      s
						lowerCAmelCase__      :		Tuple    							=      False
						lowerCAmelCase__      :		Union[str, Any]    							=      set()

						while True:
							# check if there is any non isolated nodes
							if len(self.graph[s]						) != 0:
								lowerCAmelCase__      :		Union[str, Any]    							=      s
								for node in self.graph[s]:
									if (
									    visited.count(node[1]						) > 0
									    and node[1] != parent
									    and indirect_parents.count(node[1]						) > 0
									    and not on_the_way_back
									):
										lowerCAmelCase__      :		Tuple    							=      len(lowercase_						) - 1
										while len_stack >= 0:
											if stack[len_stack] == node[1]:
												anticipating_nodes.add(node[1]						)
												break
											else:
												anticipating_nodes.add(stack[len_stack]						)
												len_stack -= 1
									if visited.count(node[1]						) < 1:
										stack.append(node[1]						)
										visited.append(node[1]						)
										lowerCAmelCase__      :		Optional[int]    							=      node[1]
										break

            # check if all the children are visited
							if s == ss:
								stack.pop()
								lowerCAmelCase__      :		Optional[int]    							=      True
								if len(lowercase_						) != 0:
									lowerCAmelCase__      :		str    							=      stack[len(lowercase_						) - 1]
							else:
								lowerCAmelCase__      :		Tuple    							=      False
								indirect_parents.append(lowercase_						)
								lowerCAmelCase__      :		Optional[int]    							=      s
								lowerCAmelCase__      :		Optional[int]    							=      ss

							# check if se have reached the starting point
							if len(lowercase_						) == 0:
								return list(lowercase_						)







					def 			__lowerCAmelCase					(			self     :							Optional[Any]						):
						lowerCAmelCase__      :		Optional[Any]    							=      []
						lowerCAmelCase__      :		Union[str, Any]    							=      []
						lowerCAmelCase__      :		Tuple    							=      list(self.graph						)[0]
						stack.append(lowercase_						)
						visited.append(lowercase_						)
						lowerCAmelCase__      :		Dict    							=      -2
						lowerCAmelCase__      :		Union[str, Any]    							=      []
						lowerCAmelCase__      :		Optional[Any]    							=      s
						lowerCAmelCase__      :		Any    							=      False
						lowerCAmelCase__      :		Optional[int]    							=      set()

						while True:
							# check if there is any non isolated nodes
							if len(self.graph[s]						) != 0:
								lowerCAmelCase__      :		str    							=      s
								for node in self.graph[s]:
									if (
									    visited.count(node[1]						) > 0
									    and node[1] != parent
									    and indirect_parents.count(node[1]						) > 0
									    and not on_the_way_back
									):
										lowerCAmelCase__      :		str    							=      len(lowercase_						) - 1
										while len_stack_minus_one >= 0:
											if stack[len_stack_minus_one] == node[1]:
												anticipating_nodes.add(node[1]						)
												break
											else:
												return True
									if visited.count(node[1]						) < 1:
										stack.append(node[1]						)
										visited.append(node[1]						)
										lowerCAmelCase__      :		List[str]    							=      node[1]
										break

            # check if all the children are visited
							if s == ss:
								stack.pop()
								lowerCAmelCase__      :		List[Any]    							=      True
								if len(lowercase_						) != 0:
									lowerCAmelCase__      :		List[str]    							=      stack[len(lowercase_						) - 1]
							else:
								lowerCAmelCase__      :		List[str]    							=      False
								indirect_parents.append(lowercase_						)
								lowerCAmelCase__      :		Optional[int]    							=      s
								lowerCAmelCase__      :		List[Any]    							=      ss

							# check if se have reached the starting point
							if len(lowercase_						) == 0:
								return False







					def 			__lowerCAmelCase					(			self     :							str						):
						return list(self.graph						)







					def 			__lowerCAmelCase					(			self     :							Any  ,lowercase_     :							Optional[int]=-2  ,lowercase_     :							Any=-1						):
						lowerCAmelCase__      :		Dict    							=      time()
						self.dfs(lowercase_  ,lowercase_						)
						lowerCAmelCase__      :		List[str]    							=      time()
						return end - begin







					def 			__lowerCAmelCase					(			self     :							Union[str, Any]  ,lowercase_     :							int=-2						):
						lowerCAmelCase__      :		Dict    							=      time()
						self.bfs(lowercase_						)
						lowerCAmelCase__      :		Any    							=      time()
						return end - begin




