

"""simple docstring"""




__UpperCAmelCase	=			[[0, 1, 1], [0, 0, 1], [1, 0, 0]]







class        __lowercase     :

		def __init__(					self						:     List[Any]   ,A						:     Union[str, Any]      ):






			'''simple docstring'''
			UpperCAmelCase__   :					str   				=   name
			UpperCAmelCase__   :					Optional[Any]   				=   []
			UpperCAmelCase__   :					Union[str, Any]   				=   []

		def 				__lowercase    (					self						:     Optional[Any]   ,A						:     Optional[int]      ):






			'''simple docstring'''
			self.inbound.append(lowerCAmelCase__      )

		def 				__lowercase    (					self						:     Dict   ,A						:     List[str]      ):






			'''simple docstring'''
			self.outbound.append(lowerCAmelCase__      )




		def __repr__(					self						:     Dict      ):






			'''simple docstring'''
			return f"<node={self.name} inbound={self.inbound} outbound={self.outbound}>"







def 					lowerCAmelCase  (   __UpperCamelCase							,      __UpperCamelCase=3							,      __UpperCamelCase=0.85 ):
	'''simple docstring'''





	UpperCAmelCase__   :					List[Any]   				=   {}
	for node in nodes:
		UpperCAmelCase__   :					Any   				=   1

	UpperCAmelCase__   :					List[str]   				=   {}
	for node in nodes:
		UpperCAmelCase__   :					List[str]   				=   len(node.outbound )

	for i in range(__UpperCamelCase ):
		print(F"======= Iteration {i + 1} =======" )
		for _, node in enumerate(__UpperCamelCase ):
			UpperCAmelCase__   :					Optional[int]   				=   (1 - d) + d * sum(
			    ranks[ib] / outbounds[ib] for ib in node.inbound )
		print(__UpperCamelCase )
def 					lowerCAmelCase  (   ):
	'''simple docstring'''





	UpperCAmelCase__   :					int   				=   list(input("""Enter Names of the Nodes: """ ).split() )

	UpperCAmelCase__   :					Optional[Any]   				=   [Node(__UpperCamelCase ) for name in names]

	for ri, row in enumerate(__UpperCamelCase ):
		for ci, col in enumerate(__UpperCamelCase ):
			if col == 1:
				nodes[ci].add_inbound(names[ri] )
				nodes[ri].add_outbound(names[ci] )

	print("""======= Nodes =======""" )
	for node in nodes:
		print(__UpperCamelCase )

	page_rank(__UpperCamelCase )


if __name__ == "__main__":
						main()








"""simple docstring"""




def 					lowerCAmelCase  (   __UpperCamelCase ):
 '''simple docstring'''





 UpperCAmelCase__   :					Union[str, Any]   				=   1
 UpperCAmelCase__   :					Union[str, Any]   				=   0
 UpperCAmelCase__   :					List[str]   				=   1
 UpperCAmelCase__   :					Any   				=   1
 UpperCAmelCase__   :					Optional[int]   				=   3
 UpperCAmelCase__   :					Any   				=   3
 UpperCAmelCase__   :					Optional[Any]   				=   limit
 UpperCAmelCase__   :					Dict   				=   0

 UpperCAmelCase__   :					int   				=   """"""
 while counter != decimal + 1:
  if 4 * q + r - t < n * t:
   result += str(__UpperCamelCase )
   if counter == 0:
    result += "."

   if decimal == counter:
    break

   counter += 1
   UpperCAmelCase__   :					Union[str, Any]   				=   10 * (r - n * t)
   UpperCAmelCase__   :					int   				=   ((10 * (3 * q + r)) // t) - 10 * n
   q *= 10
   UpperCAmelCase__   :					str   				=   nr
  else:
   UpperCAmelCase__   :					List[str]   				=   (2 * q + r) * l
   UpperCAmelCase__   :					Union[str, Any]   				=   (q * (7 * k) + 2 + (r * l)) // (t * l)
   q *= k
   t *= l
   l += 2
   k += 1
   UpperCAmelCase__   :					Optional[Any]   				=   nn
   UpperCAmelCase__   :					str   				=   nr
 return result
def 					lowerCAmelCase  (   ):
 '''simple docstring'''





 print(F"{calculate_pi(50 ) = }" )
 import doctest

 doctest.testmod()


if __name__ == "__main__":
      main()





