




'''simple docstring'''

from random import randint, random


def 		__magic_name__    (	__UpperCAmelCase,      __UpperCAmelCase,      __UpperCAmelCase,      __UpperCAmelCase = False,      __UpperCAmelCase = False,      __UpperCAmelCase = 5,      )		->					list:

					'''simple docstring'''

					snake_case_									=				[[-1] * number_of_cells]  # Create a highway without any car
					snake_case_									=				0
					snake_case_									=				max(__UpperCAmelCase,      0	)
					while i < number_of_cells:
										snake_case_									=				(
										    randint(0,      __UpperCAmelCase	) if random_speed else initial_speed
										)  # Place the cars
										i += (
										    randint(1,      max_speed * 2	) if random_frequency else frequency
										)  # Arbitrary number, may need tuning
					return highway


def 		__magic_name__    (	__UpperCAmelCase,      __UpperCAmelCase	)		->					int:

					'''simple docstring'''

					snake_case_									=				0
					snake_case_									=				highway_now[car_index + 1 :]
					for cell in range(len(__UpperCAmelCase	)	):  # May need a better name for this
										if cells[cell] != -1:  # If the cell is not empty then
															return distance  # we have the distance we wanted
										distance += 1
					# Here if the car is near the end of the highway
					return distance + get_distance(__UpperCAmelCase,      -1	)


def 		__magic_name__    (	__UpperCAmelCase,      __UpperCAmelCase,      __UpperCAmelCase	)		->					list:

					'''simple docstring'''

					snake_case_									=				len(__UpperCAmelCase	)
					# Beforce calculations, the highway is empty
					snake_case_									=				[-1] * number_of_cells

					for car_index in range(__UpperCAmelCase	):
										if highway_now[car_index] != -1:
															# Add 1 to the current speed of the car and cap the speed
															snake_case_									=				min(highway_now[car_index] + 1,      __UpperCAmelCase	)
															# Number of empty cell before the next car
															snake_case_									=				get_distance(__UpperCAmelCase,      __UpperCAmelCase	) - 1
															# We can't have the car causing an accident
															snake_case_									=				min(next_highway[car_index],      __UpperCAmelCase	)
															if random() < probability:
																				# Randomly, a driver will slow down
																				snake_case_									=				max(next_highway[car_index] - 1,      0	)
					return next_highway


def 		__magic_name__    (	__UpperCAmelCase,      __UpperCAmelCase,      __UpperCAmelCase,      __UpperCAmelCase	)		->					list:

					'''simple docstring'''

					snake_case_									=				len(highway[0]	)

					for i in range(__UpperCAmelCase	):
										snake_case_									=				update(highway[i],      __UpperCAmelCase,      __UpperCAmelCase	)
										snake_case_									=				[-1] * number_of_cells

										for car_index in range(__UpperCAmelCase	):
															snake_case_									=				next_speeds_calculated[car_index]
															if speed != -1:
																				# Change the position based on the speed (with % to create the loop)
																				snake_case_									=				(car_index + speed) % number_of_cells
																				# Commit the change of position
																				snake_case_									=				speed
										highway.append(__UpperCAmelCase	)

					return highway


if __name__ == "__main__":
							import doctest

							doctest.testmod()







'''simple docstring'''

import re


def 		__magic_name__    (	__UpperCAmelCase	)		->					bool:

					'''simple docstring'''

					snake_case_									=				re.compile(
					    r'''^(?:0|94|\+94|0{2}94)''' r'''7(0|1|2|4|5|6|7|8)''' r'''(-| |)''' r'''\d{7}$'''	)

					return bool(re.search(__UpperCAmelCase,      __UpperCAmelCase	)	)


if __name__ == "__main__":
							a  :				Any									=  '0094702343221'

							print(is_sri_lankan_phone_number(phone))

