




"""simple docstring"""


A_						=				{0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}

A_						=				{0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}


def 					UpperCAmelCase__       (snake_case__							:					dict[int, list[int]]		,   snake_case__							:					int		,   snake_case__							:					list[bool]    ):
  """simple docstring"""

  _snake_case							:		Union[str, Any]								=  True
  _snake_case							:		List[Any]								=  []

  for neighbour in graph[vert]:
    if not visited[neighbour]:
      order += topology_sort(snake_case__		,   snake_case__		,   snake_case__    )

  order.append(snake_case__    )

  return order


def 					UpperCAmelCase__       (snake_case__							:					dict[int, list[int]]		,   snake_case__							:					int		,   snake_case__							:					list[bool]    ):
  """simple docstring"""

  _snake_case							:		Dict								=  True
  _snake_case							:		Dict								=  [vert]

  for neighbour in reversed_graph[vert]:
    if not visited[neighbour]:
      component += find_components(snake_case__		,   snake_case__		,   snake_case__    )

  return component






def 					UpperCAmelCase__       (snake_case__							:					dict[int, list[int]]    ):
  """simple docstring"""

  _snake_case							:		Any								=  len(snake_case__    ) * [False]
  _snake_case							:		dict[int, list[int]]								=  {vert: [] for vert in range(len(snake_case__    )    )}

  for vert, neighbours in graph.items():
    for neighbour in neighbours:
      reversed_graph[neighbour].append(snake_case__    )

  _snake_case							:		Optional[Any]								=  []
  for i, was_visited in enumerate(snake_case__    ):
    if not was_visited:
      order += topology_sort(snake_case__		,   snake_case__		,   snake_case__    )

  _snake_case							:		int								=  []
  _snake_case							:		Dict								=  len(snake_case__    ) * [False]

  for i in range(len(snake_case__    )    ):
    _snake_case							:		Union[str, Any]								=  order[len(snake_case__    ) - i - 1]
    if not visited[vert]:
      _snake_case							:		Tuple								=  find_components(snake_case__		,   snake_case__		,   snake_case__    )
      components_list.append(snake_case__    )

  return components_list










import warnings
from contextlib import contextmanager

from ....processing_utils import ProcessorMixin
class     a    ( lowercase__   ):



      """simple docstring"""


      a  : List[str]							       =	'MCTCTFeatureExtractor'
      a  : str							       =	'AutoTokenizer'
      def __init__(      self					:			Tuple		,      __lowercase					:			int		,      __lowercase					:			Dict					)							->      Any:
        super().__init__(__lowercase		,      __lowercase					)
        __UpperCAmelCase							:	Optional[Any]           =  self.feature_extractor
        __UpperCAmelCase							:	Optional[int]           =  False
      def __call__(      self					:			int		,      *__lowercase					:			Tuple		,      **__lowercase					:			Optional[int]					)							->      Union[str, Any]:
        # For backward compatibility
        if self._in_target_context_manager:
          return self.current_processor(*__lowercase		,      **__lowercase					)

        if "raw_speech" in kwargs:
          warnings.warn("""Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead."""					)
          __UpperCAmelCase							:	Dict           =  kwargs.pop("""raw_speech"""					)
        else:
          __UpperCAmelCase							:	Dict           =  kwargs.pop("""audio"""		,      __lowercase					)
        __UpperCAmelCase							:	List[str]           =  kwargs.pop("""sampling_rate"""		,      __lowercase					)
        __UpperCAmelCase							:	Tuple           =  kwargs.pop("""text"""		,      __lowercase					)
        if len(__lowercase					) > 0:
          __UpperCAmelCase							:	Tuple           =  args[0]
          __UpperCAmelCase							:	str           =  args[1:]

        if audio is None and text is None:
          raise ValueError("""You need to specify either an `audio` or `text` input to process."""					)

        if audio is not None:
          __UpperCAmelCase							:	Tuple           =  self.feature_extractor(__lowercase		,      *__lowercase		,      sampling_rate=__lowercase		,      **__lowercase					)
        if text is not None:
          __UpperCAmelCase							:	str           =  self.tokenizer(__lowercase		,      **__lowercase					)

        if text is None:
          return inputs
        elif audio is None:
          return encodings
        else:
          __UpperCAmelCase							:	Dict           =  encodings["""input_ids"""]
          return inputs
      def 	UpperCAmelCase      (      self					:			Optional[Any]		,      *__lowercase					:			List[Any]		,      **__lowercase					:			int					)							->      List[Any]:
        return self.tokenizer.batch_decode(*__lowercase		,      **__lowercase					)
      def 	UpperCAmelCase      (      self					:			Optional[int]		,      *__lowercase					:			Optional[Any]		,      **__lowercase					:			List[str]					)							->      int:
        # For backward compatibility
        if self._in_target_context_manager:
          return self.current_processor.pad(*__lowercase		,      **__lowercase					)

        __UpperCAmelCase							:	Optional[int]           =  kwargs.pop("""input_features"""		,      __lowercase					)
        __UpperCAmelCase							:	Optional[Any]           =  kwargs.pop("""labels"""		,      __lowercase					)
        if len(__lowercase					) > 0:
          __UpperCAmelCase							:	Union[str, Any]           =  args[0]
          __UpperCAmelCase							:	str           =  args[1:]

        if input_features is not None:
          __UpperCAmelCase							:	Any           =  self.feature_extractor.pad(__lowercase		,      *__lowercase		,      **__lowercase					)
        if labels is not None:
          __UpperCAmelCase							:	Union[str, Any]           =  self.tokenizer.pad(__lowercase		,      **__lowercase					)

        if labels is None:
          return input_features
        elif input_features is None:
          return labels
        else:
          __UpperCAmelCase							:	Any           =  labels["""input_ids"""]
          return input_features
      def 	UpperCAmelCase      (      self					:			Any		,      *__lowercase					:			Union[str, Any]		,      **__lowercase					:			Dict					)							->      List[Any]:
        return self.tokenizer.decode(*__lowercase		,      **__lowercase					)




      @contextmanager
      def 	UpperCAmelCase      (      self					:			Optional[Any]					)							->      Tuple:
        warnings.warn(
            """`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your """
            """labels by using the argument `text` of the regular `__call__` method (either in the same call as """
            """your audio inputs, or in a separate call."""					)
        __UpperCAmelCase							:	Any           =  True
        __UpperCAmelCase							:	Optional[int]           =  self.tokenizer
        yield
        __UpperCAmelCase							:	List[Any]           =  self.feature_extractor
        __UpperCAmelCase							:	int           =  False


