
'''simple docstring'''






import math





def    UpperCAmelCase							(  UpperCAmelCase__							:							int):
				assert isinstance(UpperCAmelCase__       ,							UpperCAmelCase__) and (
				    number >= 0
				), "'number' must been an int and positive"

				if 1 < number < 4:
								# 2 and 3 are primes
								return True
				elif number < 2 or not number % 2:
								# Negatives, 0, 1 and all even numbers are not primes
								return False

				lowerCamelCase					:			List[Any]									= range(3       ,							int(math.sqrt(UpperCAmelCase__) + 1)       ,							2)
				return not any(not number % i for i in odd_numbers)





def    UpperCAmelCase							(  UpperCAmelCase__							:							int       ,							UpperCAmelCase__							:							Dict=1       ,							**UpperCAmelCase__							:							int):
				lowerCamelCase					:			int									= factor * value
				lowerCamelCase					:			List[str]									= value

				while not is_prime(UpperCAmelCase__):
								value += 1 if not ("desc" in kwargs and kwargs["desc"] is True) else -1

				if value == first_value_val:
								return next_prime(value + 1       ,							**UpperCAmelCase__)
				return value


'''simple docstring'''






def    UpperCAmelCase							(  UpperCAmelCase__							:							list[int]):
				if not nums:  # Makes sure that the list is not empty
								raise ValueError('List is empty')

				lowerCamelCase					:			int									= sum(UpperCAmelCase__) / len(UpperCAmelCase__)  # Calculate the average
				return sum(abs(x - average) for x in nums) / len(UpperCAmelCase__)


if __name__ == "__main__":
					import doctest

					doctest.testmod()
