
'''simple docstring'''




from collections import deque







def 		lowerCAmelCase_				(   snake_case__						):




    '''simple docstring'''



    A       :   Dict					=						len(snake_case__						)
    A       :   str					=						deque()
    A       :   int					=						[False for _ in range(snake_case__						)]
    A       :   List[Any]					=						[-1 for _ in range(snake_case__						)]
    A       :   Optional[int]					=						index_of[:]

    def strong_connect(snake_case__		,				snake_case__		,				snake_case__						):
        A       :   int					=						index  # the number when this node is seen
        A       :   Tuple					=						index  # lowest rank node reachable from here
        index += 1
        stack.append(snake_case__						)
        A       :   List[str]					=						True

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

        if lowlink_of[v] == index_of[v]:
            A       :   Optional[int]					=						[]
            A       :   List[str]					=						stack.pop()
            A       :   List[str]					=						False
            component.append(snake_case__						)
            while w != v:
                A       :   Optional[Any]					=						stack.pop()
                A       :   List[str]					=						False
                component.append(snake_case__						)
            components.append(snake_case__						)
        return index

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

    return components







def 		lowerCAmelCase_				(   snake_case__		,				snake_case__						):




    '''simple docstring'''



    A       :   Optional[Any]					=						[[] for _ in range(snake_case__						)]
    for u, v in edges:
        g[u].append(snake_case__						)
    return g


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

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






def a__    (       A_					):






  '''simple docstring'''





  if not isinstance(A_,     A_					):
    raise ValueError("""Input series is not valid, valid series - [2, 4, 6]"""					)
  if len(A_					) == 0:
    raise ValueError("""Input list must be a non empty list"""					)
  if len(A_					) == 1:
    return True
  __magic_name__				     =       series[1] - series[0]
  for index in range(len(A_					) - 1					):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True

def a__    (       A_					):






  '''simple docstring'''





  if not isinstance(A_,     A_					):
    raise ValueError("""Input series is not valid, valid series - [2, 4, 6]"""					)
  if len(A_					) == 0:
    raise ValueError("""Input list must be a non empty list"""					)
  __magic_name__				     =       0
  for val in series:
    answer += val
  return answer / len(A_					)


if __name__ == "__main__":
    import doctest

    doctest.testmod()

