
from collections import deque


def     UpperCAmelCase_  (						__lowerCAmelCase	) ->						List[Any]:
    __lowercase		:			Tuple	    =       len(__UpperCamelCase	)
    __lowercase		:			Union[str, Any]	    =       deque()
    __lowercase		:			Optional[int]	    =       [False for _ in range(__UpperCamelCase	)]
    __lowercase		:			List[str]	    =       [-1 for _ in range(__UpperCamelCase	)]
    __lowercase		:			Dict	    =       index_of[:]

    def strong_connect(__lowerCAmelCase	,					__lowerCAmelCase	,					__lowerCAmelCase	):
        __lowercase		:			Dict	    =       index  # the number when this node is seen
        __lowercase		:			Tuple	    =       index  # lowest rank node reachable from here
        index += 1
        stack.append(__UpperCamelCase	)
        __lowercase		:			Optional[int]	    =       True

        for w in g[v]:
            if index_of[w] == -1:
                __lowercase		:			List[str]	    =       strong_connect(__UpperCamelCase	,					__UpperCamelCase	,					__UpperCamelCase	)
                __lowercase		:			List[Any]	    =       (
                    lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                )
            elif on_stack[w]:
                __lowercase		:			List[str]	    =       (
                    lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                )

        if lowlink_of[v] == index_of[v]:
            __lowercase		:			Tuple	    =       []
            __lowercase		:			List[Any]	    =       stack.pop()
            __lowercase		:			List[Any]	    =       False
            component.append(__UpperCamelCase	)
            while w != v:
                __lowercase		:			Any	    =       stack.pop()
                __lowercase		:			Union[str, Any]	    =       False
                component.append(__UpperCamelCase	)
            components.append(__UpperCamelCase	)
        return index

    __lowercase		:			List[str]	    =       []
    for v in range(__UpperCamelCase	):
        if index_of[v] == -1:
            strong_connect(__UpperCamelCase	,					0	,					__UpperCamelCase	)

    return components


def     UpperCAmelCase_  (						__lowerCAmelCase	,					__lowerCAmelCase	) ->						Dict:
    __lowercase		:			Tuple	    =       [[] for _ in range(__UpperCamelCase	)]
    for u, v in edges:
        g[u].append(__UpperCamelCase	)
    return g


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

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




__lowerCAmelCase					:			Dict			      =		"\n# Installazione di Transformers\n! pip install transformers datasets\n# Per installare dalla fonte invece dell'ultima versione rilasciata, commenta il comando sopra e\n# rimuovi la modalità commento al comando seguente.\n# ! pip install git+https://github.com/huggingface/transformers.git\n"

__lowerCAmelCase					:			Tuple			      =		[{"type": "code", "content": INSTALL_CONTENT}]
__lowerCAmelCase					:			List[Any]			      =		{
    "{processor_class}": "FakeProcessorClass",
    "{model_class}": "FakeModelClass",
    "{object_class}": "FakeObjectClass",
}


