


import os
import sys

snake_case							:       int										=	os.path.join(os.path.dirname(__file__), '''src''')
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


snake_case							:       Optional[int]										=	[
    '''torch''',
    '''numpy''',
    '''tokenizers''',
    '''filelock''',
    '''requests''',
    '''tqdm''',
    '''regex''',
    '''sentencepiece''',
    '''sacremoses''',
    '''importlib_metadata''',
    '''huggingface_hub''',
]
@add_start_docstrings(AutoConfig.__doc__		)
def 							__lowerCamelCase		(					*UpperCAmelCase_		:						Optional[Any]					,    **UpperCAmelCase_		:						str		):




      """simple docstring"""





      return AutoConfig.from_pretrained(*UpperCAmelCase_					,    **UpperCAmelCase_		)
@add_start_docstrings(AutoTokenizer.__doc__		)
def 							__lowerCamelCase		(					*UpperCAmelCase_		:						str					,    **UpperCAmelCase_		:						List[str]		):




      """simple docstring"""





      return AutoTokenizer.from_pretrained(*UpperCAmelCase_					,    **UpperCAmelCase_		)
@add_start_docstrings(AutoModel.__doc__		)
def 							__lowerCamelCase		(					*UpperCAmelCase_		:						int					,    **UpperCAmelCase_		:						Any		):




      """simple docstring"""





      return AutoModel.from_pretrained(*UpperCAmelCase_					,    **UpperCAmelCase_		)
@add_start_docstrings(AutoModelForCausalLM.__doc__		)
def 							__lowerCamelCase		(					*UpperCAmelCase_		:						Any					,    **UpperCAmelCase_		:						Tuple		):




      """simple docstring"""





      return AutoModelForCausalLM.from_pretrained(*UpperCAmelCase_					,    **UpperCAmelCase_		)
@add_start_docstrings(AutoModelForMaskedLM.__doc__		)
def 							__lowerCamelCase		(					*UpperCAmelCase_		:						Dict					,    **UpperCAmelCase_		:						Tuple		):




      """simple docstring"""





      return AutoModelForMaskedLM.from_pretrained(*UpperCAmelCase_					,    **UpperCAmelCase_		)
@add_start_docstrings(AutoModelForSequenceClassification.__doc__		)
def 							__lowerCamelCase		(					*UpperCAmelCase_		:						str					,    **UpperCAmelCase_		:						str		):




      """simple docstring"""





      return AutoModelForSequenceClassification.from_pretrained(*UpperCAmelCase_					,    **UpperCAmelCase_		)






@add_start_docstrings(AutoModelForQuestionAnswering.__doc__		)
def 							__lowerCamelCase		(					*UpperCAmelCase_		:						List[Any]					,    **UpperCAmelCase_		:						str		):




      """simple docstring"""





      return AutoModelForQuestionAnswering.from_pretrained(*UpperCAmelCase_					,    **UpperCAmelCase_		)









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

snake_case							:       Any										=	{0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}
def 							__lowerCamelCase		(					UpperCAmelCase_		:						dict[int, list[int]]					,    UpperCAmelCase_		:						int					,    UpperCAmelCase_		:						list[bool]		):




      """simple docstring"""





      a		:Any									=			True
      a		:Any									=			[]

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

      order.append(UpperCAmelCase_		)

      return order
def 							__lowerCamelCase		(					UpperCAmelCase_		:						dict[int, list[int]]					,    UpperCAmelCase_		:						int					,    UpperCAmelCase_		:						list[bool]		):




      """simple docstring"""





      a		:Optional[Any]									=			True
      a		:int									=			[vert]

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

      return component






def 							__lowerCamelCase		(					UpperCAmelCase_		:						dict[int, list[int]]		):




      """simple docstring"""





      a		:int									=			len(UpperCAmelCase_		) * [False]
      a		:dict[int, list[int]]									=			{vert: [] for vert in range(len(UpperCAmelCase_		)		)}

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

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

      a		:Tuple									=			[]
      a		:int									=			len(UpperCAmelCase_		) * [False]

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

      return components_list





