
"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_lowercase							      = {
    '''configuration_whisper''': ['''WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''WhisperConfig''', '''WhisperOnnxConfig'''],
    '''feature_extraction_whisper''': ['''WhisperFeatureExtractor'''],
    '''processing_whisper''': ['''WhisperProcessor'''],
    '''tokenization_whisper''': ['''WhisperTokenizer'''],
}

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase							      = ['''WhisperTokenizerFast''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase							      = [
		    '''WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''WhisperForConditionalGeneration''',
		    '''WhisperModel''',
		    '''WhisperPreTrainedModel''',
		    '''WhisperForAudioClassification''',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase							      = [
		    '''TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''TFWhisperForConditionalGeneration''',
		    '''TFWhisperModel''',
		    '''TFWhisperPreTrainedModel''',
		]

try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase							      = [
		    '''FlaxWhisperForConditionalGeneration''',
		    '''FlaxWhisperModel''',
		    '''FlaxWhisperPreTrainedModel''',
		    '''FlaxWhisperForAudioClassification''',
		]


if TYPE_CHECKING:
		from .configuration_whisper import WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP, WhisperConfig, WhisperOnnxConfig
		from .feature_extraction_whisper import WhisperFeatureExtractor
		from .processing_whisper import WhisperProcessor
		from .tokenization_whisper import WhisperTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_whisper_fast import WhisperTokenizerFast

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_whisper import (
				    WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    WhisperForAudioClassification,
				    WhisperForConditionalGeneration,
				    WhisperModel,
				    WhisperPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_whisper import (
				    TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFWhisperForConditionalGeneration,
				    TFWhisperModel,
				    TFWhisperPreTrainedModel,
				)

		try:
				if not is_flax_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_flax_whisper import (
				    FlaxWhisperForAudioClassification,
				    FlaxWhisperForConditionalGeneration,
				    FlaxWhisperModel,
				    FlaxWhisperPreTrainedModel,
				)

else:
		import sys

		_lowercase							      = _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

from collections import deque





def 			lowerCamelCase_ (				lowerCamelCase__    ):
				lowerCamelCase_						=			len(lowerCamelCase__    )
				lowerCamelCase_						=			deque()
				lowerCamelCase_						=			[False for _ in range(lowerCamelCase__    )]
				lowerCamelCase_						=			[-1 for _ in range(lowerCamelCase__    )]
				lowerCamelCase_						=			index_of[:]

				def strong_connect(lowerCamelCase__	, lowerCamelCase__	, lowerCamelCase__    ):
								lowerCamelCase_						=			index  # the number when this node is seen
								lowerCamelCase_						=			index  # lowest rank node reachable from here
								index += 1
								stack.append(lowerCamelCase__    )
								lowerCamelCase_						=			True

								for w in g[v]:
												if index_of[w] == -1:
																lowerCamelCase_						=			strong_connect(lowerCamelCase__	, lowerCamelCase__	, lowerCamelCase__    )
																lowerCamelCase_						=			(
																    lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
																)
												elif on_stack[w]:
																lowerCamelCase_						=			(
																    lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
																)

								if lowlink_of[v] == index_of[v]:
												lowerCamelCase_						=			[]
												lowerCamelCase_						=			stack.pop()
												lowerCamelCase_						=			False
												component.append(lowerCamelCase__    )
												while w != v:
																lowerCamelCase_						=			stack.pop()
																lowerCamelCase_						=			False
																component.append(lowerCamelCase__    )
												components.append(lowerCamelCase__    )
								return index

				lowerCamelCase_						=			[]
				for v in range(lowerCamelCase__    ):
								if index_of[v] == -1:
												strong_connect(lowerCamelCase__	, 0	, lowerCamelCase__    )

				return components





def 			lowerCamelCase_ (				lowerCamelCase__	, lowerCamelCase__    ):
				lowerCamelCase_						=			[[] for _ in range(lowerCamelCase__    )]
				for u, v in edges:
								g[u].append(lowerCamelCase__    )
				return g


if __name__ == "__main__":
			# Test
			__A				=7
			__A				=[0, 0, 1, 2, 3, 3, 4, 4, 6]
			__A				=[1, 3, 2, 0, 1, 4, 5, 6, 5]
			__A				=[(u, v) for u, v in zip(source, target)]
			__A				=create_graph(n_vertices, edges)

			assert [[5], [6], [4], [3, 2, 1, 0]] == tarjan(g)


