


from collections import deque




def    snake_case_     (  snake_case     )  ->				List[Any]:
       lowercase__:   str  			=   len(snake_case     )
       lowercase__:   Union[str, Any]  			=   deque()
       lowercase__:   Optional[int]  			=   [False for _ in range(snake_case     )]
       lowercase__:   Optional[Any]  			=   [-1 for _ in range(snake_case     )]
       lowercase__:   int  			=   index_of[:]

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

              for w in g[v]:
                     if index_of[w] == -1:
                            lowercase__:   List[str]  			=   strong_connect(snake_case			,							snake_case			,							snake_case     )
                            lowercase__:   Dict  			=   (
                                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__:   Any  			=   []
                     lowercase__:   str  			=   stack.pop()
                     lowercase__:   List[Any]  			=   False
                     component.append(snake_case     )
                     while w != v:
                            lowercase__:   List[Any]  			=   stack.pop()
                            lowercase__:   List[str]  			=   False
                            component.append(snake_case     )
                     components.append(snake_case     )
              return index

       lowercase__:   Any  			=   []
       for v in range(snake_case     ):
              if index_of[v] == -1:
                     strong_connect(snake_case			,							0			,							snake_case     )

       return components




def    snake_case_     (  snake_case			,							snake_case     )  ->				Dict:
       lowercase__:   Tuple  			=   [[] for _ in range(snake_case     )]
       for u, v in edges:
              g[u].append(snake_case     )
       return g


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

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






def    snake_case_     (  snake_case			,							snake_case     )  ->				str:
       if number < 0 or shift_amount < 0:
              raise ValueError('both inputs must be positive integers'     )

       lowercase__:   str  			=   str(bin(snake_case     )     )
       binary_number += "0" * shift_amount
       return binary_number




def    snake_case_     (  snake_case			,							snake_case     )  ->				str:
       if number < 0 or shift_amount < 0:
              raise ValueError('both inputs must be positive integers'     )

       lowercase__:   Optional[Any]  			=   str(bin(snake_case     )     )[2:]
       if shift_amount >= len(snake_case     ):
              return "0b0"
       lowercase__:   Optional[int]  			=   binary_number[: len(snake_case     ) - shift_amount]
       return "0b" + shifted_binary_number




def    snake_case_     (  snake_case			,							snake_case     )  ->				str:
       if number >= 0:  # Get binary representation of positive number
              lowercase__:   Union[str, Any]  			=   '0' + str(bin(snake_case     )     ).strip('-'     )[2:]
       else:  # Get binary (2's complement) representation of negative number
              lowercase__:   Dict  			=   len(bin(snake_case     )[3:]     )  # Find 2's complement of number
              lowercase__:   int  			=   bin(abs(snake_case     ) - (1 << binary_number_length)     )[3:]
              lowercase__:   Any  			=   (
                  '1' + '0' * (binary_number_length - len(snake_case     )) + binary_number
              )

       if shift_amount >= len(snake_case     ):
              return "0b" + binary_number[0] * len(snake_case     )
       return (
           "0b"
           + binary_number[0] * shift_amount
           + binary_number[: len(snake_case     ) - shift_amount]
       )


if __name__ == "__main__":
 import doctest

 doctest.testmod()


