

'''simple docstring'''





from timeit import timeit

UpperCamelCase_    						=       {
    """MALAYALAM""": True,
    """String""": False,
    """rotor""": True,
    """level""": True,
    """A""": True,
    """BB""": True,
    """ABC""": False,
    """amanaplanacanalpanama""": True,  # "a man a plan a canal panama"
}
# Ensure our test data is valid
assert all((key == key[::-1]) is value for key, value in test_data.items())






def 				_lowerCAmelCase			(   __magic_name__						:     str						)				->  bool:
						lowercase :							Tuple    		=0
						lowercase :							Union[str, Any]    		=len(__magic_name__						) - 1
						while start_i < end_i:
												if s[start_i] == s[end_i]:
																		start_i += 1
																		end_i -= 1
												else:
																		return False
						return True






def 				_lowerCAmelCase			(   __magic_name__						:     str						)				->  bool:
						lowercase :							List[str]    		=len(__magic_name__						) // 2
						lowercase :							List[str]    		=len(__magic_name__						)

						# We need to traverse till half of the length of string
						# as we can get access of the i'th last element from
						# i'th index.
						# eg: [0,1,2,3,4,5] => 4th index can be accessed
						# with the help of 1st index (i==n-i-1)
						# where n is length of string
						return all(s[i] == s[n - i - 1] for i in range(__magic_name__						)						)






def 				_lowerCAmelCase			(   __magic_name__						:     str						)				->  bool:
						if len(__magic_name__						) <= 2:
												return True
						if s[0] == s[len(__magic_name__						) - 1]:
												return is_palindrome_recursive(s[1:-1]						)
						else:
												return False






def 				_lowerCAmelCase			(   __magic_name__						:     str						)				->  bool:
						return s == s[::-1]






def 				_lowerCAmelCase			(   __magic_name__						:     str						)				->  None:
						lowercase :							int    		=f'''all({name}(key) is value for key, value in test_data.items())'''
						lowercase :							Optional[Any]    		=f'''from __main__ import test_data, {name}'''
						lowercase :							int    		=500000
						lowercase :							List[str]    		=timeit(stmt=__magic_name__   , setup=__magic_name__   , number=__magic_name__						)
						print(f'''{name:<35} finished {number:,} runs in {result:.5f} seconds'''						)


if __name__ == "__main__":
							for key, value in test_data.items():
														assert is_palindrome(key) is is_palindrome_recursive(key)
														assert is_palindrome(key) is is_palindrome_slice(key)
														print(f'''{key:21} {value}''')
							print("""a man a plan a canal panama""")

							# finished 500,000 runs in 0.46793 seconds
							benchmark_function("""is_palindrome_slice""")
							# finished 500,000 runs in 0.85234 seconds
							benchmark_function("""is_palindrome""")
							# finished 500,000 runs in 1.32028 seconds
							benchmark_function("""is_palindrome_recursive""")
							# finished 500,000 runs in 2.08679 seconds
							benchmark_function("""is_palindrome_traversal""")











from math import sqrt

import numpy as np
from sympy import symbols

# Coefficient
# Speed of light (m/s)
_lowerCamelCase      :						str							=  299792458

# Symbols
_lowerCamelCase			,     _lowerCamelCase			,     _lowerCamelCase			,     _lowerCamelCase      :						int							=  symbols("""ct x y z""")







def SCREAMING_SNAKE_CASE							(			lowercase_		)  ->			float:



       """simple docstring"""

       if velocity > c:
              raise ValueError('''Speed must not exceed light speed 299,792,458 [m/s]!'''		)
       elif velocity < 1:
              # Usually the speed should be much higher than 1 (c order of magnitude)
              raise ValueError('''Speed must be greater than or equal to 1!'''		)

       return velocity / c







def SCREAMING_SNAKE_CASE							(			lowercase_		)  ->			float:



       """simple docstring"""

       return 1 / sqrt(1 - beta(lowercase_		) ** 2		)







def SCREAMING_SNAKE_CASE							(			lowercase_		)  ->			np.ndarray:



       """simple docstring"""

       return np.array(
           [
               [gamma(lowercase_		), -gamma(lowercase_		) * beta(lowercase_		), 0, 0],
               [-gamma(lowercase_		) * beta(lowercase_		), gamma(lowercase_		), 0, 0],
               [0, 0, 1, 0],
               [0, 0, 0, 1],
           ]		)







def SCREAMING_SNAKE_CASE							(			lowercase_					,							lowercase_ = None		)  ->			np.ndarray:



       """simple docstring"""

       if event is None:
              A__ 					=       np.array([ct, x, y, z]		)  # Symbolic four vector
       else:
              event[0] *= c  # x0 is ct (speed of light * time)

       return transformation_matrix(lowercase_		) @ event


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  # Example of symbolic vector:
  _lowerCamelCase      :						Tuple							=  transform(29979245)
  print("""Example of four vector: """)
  print(F'''ct\' = {four_vector[0]}''')
  print(F'''x\' = {four_vector[1]}''')
  print(F'''y\' = {four_vector[2]}''')
  print(F'''z\' = {four_vector[3]}''')

  # Substitute symbols with numerical values
  _lowerCamelCase      :						int							=  {ct: c, x: 1, y: 1, z: 1}
  _lowerCamelCase      :						Any							=  [four_vector[i].subs(sub_dict) for i in range(4)]

  print(F'''\n{numerical_vector}''')


