import numpy as np
from sklearn.datasets import fetch_california_housing
from sklearn.metrics import mean_absolute_error, mean_squared_error
from sklearn.model_selection import train_test_split
from xgboost import XGBRegressor







def     _a				(      lowercase__  :			dict ):







     '''simple docstring'''


     return (data["data"], data["target"])







def     _a				(      lowercase__  :			np.ndarray     ,  lowercase__  :			np.ndarray     ,  lowercase__  :			np.ndarray ):







     '''simple docstring'''


     __A				:				int			=		XGBRegressor(verbosity=0     ,  random_state=42 )
     xgb.fit(lowercase__     ,  lowercase__ )
     # Predict target for test data
     __A				:				Union[str, Any]			=		xgb.predict(lowercase__ )
     __A				:				int			=		predictions.reshape(len(lowercase__ )     ,  1 )
     return predictions







def     _a				(      ):







     '''simple docstring'''


     __A				:				Union[str, Any]			=		fetch_california_housing()
     __A				:				List[str]			=		data_handling(lowercase__ )
     __A				:				List[Any]			=		train_test_split(
         lowercase__     ,  lowercase__     ,  test_size=0.25     ,  random_state=1 )
     __A				:				Any			=		xgboost(lowercase__     ,  lowercase__     ,  lowercase__ )
     # Error printing
     print(f'''Mean Absolute Error : {mean_absolute_error(lowercase__     ,  lowercase__ )}''' )
     print(f'''Mean Square Error  : {mean_squared_error(lowercase__     ,  lowercase__ )}''' )


if __name__ == "__main__":
      import doctest

      doctest.testmod(verbose=True)
      main()




import math







def     _a				(      lowercase__  :			int ):







     '''simple docstring'''


     assert isinstance(lowercase__     ,  lowercase__ ) 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

     SCREAMING_SNAKE_CASE__				:				Tuple			=		range(3     ,  int(math.sqrt(lowercase__ ) + 1 )     ,  2 )
     return not any(not number % i for i in odd_numbers )







def     _a				(      lowercase__  :			List[str]     ,  lowercase__  :			Any=1     ,  **lowercase__  :			Any ):







     '''simple docstring'''


     SCREAMING_SNAKE_CASE__				:				int			=		factor * value
     SCREAMING_SNAKE_CASE__				:				Dict			=		value

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

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



