

from collections import deque

def       __snake_case						( __UpperCamelCase	: int    ):



      """simple docstring"""

      A_						  =				len(__UpperCamelCase    )
      A_						  =				deque()
      A_						  =				[False for _ in range(__UpperCamelCase    )]
      A_						  =				[-1 for _ in range(__UpperCamelCase    )]
      A_						  =				index_of[:]

      def strong_connect(__UpperCamelCase	: List[str]				,__UpperCamelCase	: str				,__UpperCamelCase	: Union[str, Any]    ):
            A_						  =				index  # the number when this node is seen
            A_						  =				index  # lowest rank node reachable from here
            index += 1
            stack.append(__UpperCamelCase    )
            A_						  =				True

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

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

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

      return components

def       __snake_case						( __UpperCamelCase	: Any				,__UpperCamelCase	: Tuple    ):



      """simple docstring"""

      A_						  =				[[] for _ in range(__UpperCamelCase    )]
      for u, v in edges:
            g[u].append(__UpperCamelCase    )
      return g


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

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





'''simple docstring'''


from unittest.mock import Mock, patch

from file_transfer.send_file import send_file



@patch("""socket.socket"""				)
@patch("""builtins.open"""				)
def  _SCREAMING_SNAKE_CASE     (      UpperCamelCase__    :					Dict ,    UpperCamelCase__    :					Tuple				):




     """simple docstring"""


     a_     :							Dict     						=  Mock()
     a_     :							List[str]     						=  conn, Mock()
     a_     :							Optional[int]     						=  iter([1, None]				)
     a_     :							List[str]     						=  lambda UpperCamelCase__				: next(UpperCamelCase__				)

     # ===== invoke =====
     send_file(filename="""mytext.txt""" ,    testing=UpperCamelCase__				)

     # ===== ensurance =====
     sock.assert_called_once()
     sock.return_value.bind.assert_called_once()
     sock.return_value.listen.assert_called_once()
     sock.return_value.accept.assert_called_once()
     conn.recv.assert_called_once()

     file.return_value.__enter__.assert_called_once()
     file.return_value.__enter__.return_value.read.assert_called()

     conn.send.assert_called_once()
     conn.close.assert_called_once()
     sock.return_value.shutdown.assert_called_once()
     sock.return_value.close.assert_called_once()
