code: 
  
  
  """simple docstring"""
  
  
  
  
  
  
  
  import math
  
  
  
  
  
  
  class    __A       :
  
  
  
  
  
  
  	"""simple docstring"""
  
  
  
  
  	def __init__(	self				,					__A				,					__A				,					__A				,					__A		)      ->  int:
  					a					=x
  					a					=y
  					a					=step_size
  					a					=function_to_optimize
  
  
  	def    SCREAMING_SNAKE_CASE							(	self		)      ->  int:
  					return self.function(self.x				,					self.y		)
  
  
  	def    SCREAMING_SNAKE_CASE							(	self		)      ->  str:
  					a					=self.step_size
  					return [
  					    SearchProblem(__A				,					__A				,					__A				,					self.function		)
  					    for x, y in (
  					        (self.x - step_size, self.y - step_size),
  					        (self.x - step_size, self.y),
  					        (self.x - step_size, self.y + step_size),
  					        (self.x, self.y - step_size),
  					        (self.x, self.y + step_size),
  					        (self.x + step_size, self.y - step_size),
  					        (self.x + step_size, self.y),
  					        (self.x + step_size, self.y + step_size),
  					    )
  					]
  
  
  	def __hash__(	self		)      ->  List[Any]:
  					return hash(str(self		)		)
  
  
  	def __eq__(	self				,					__A		)      ->  Union[str, Any]:
  					if isinstance(__A				,					__A		):
  									return hash(str(self		)		) == hash(str(__A		)		)
  					return False
  
  
  
  
  
  	def __str__(	self		)      ->  int:
  					return f'''x: {self.x} y: {self.y}'''
  
  def _A		(		lowercase ,					lowercase = True ,					lowercase = math.inf ,					lowercase = -math.inf ,					lowercase = math.inf ,					lowercase = -math.inf ,					lowercase = False ,					lowercase = 1_00_00 ,					):
  
  
  
  
  
  
  
  				"""simple docstring"""
  				a					=search_prob
  				a					=[]  # list to store the current score at each iteration
  				a					=0
  				a					=False
  				a					=set()
  				while not solution_found and iterations < max_iter:
  								visited.add(lowercase	)
  								iterations += 1
  								a					=current_state.score()
  								scores.append(lowercase	)
  								a					=current_state.get_neighbors()
  								a					=-math.inf
  								a					=math.inf
  								a					=None  # to hold the next best neighbor
  								for neighbor in neighbors:
  												if neighbor in visited:
  																continue  # do not want to visit the same state again
  												if (
  												    neighbor.x > max_x
  												    or neighbor.x < min_x
  												    or neighbor.y > max_y
  												    or neighbor.y < min_y
  												):
  																continue  # neighbor outside our bounds
  												a					=neighbor.score() - current_score
  												if find_max:  # finding max
  																# going to direction with greatest ascent
  																if change > max_change and change > 0:
  																				a					=change
  																				a					=neighbor
  												else:  # finding min
  																# to direction with greatest descent
  																if change < min_change and change < 0:
  																				a					=change
  																				a					=neighbor
  								if next_state is not None:
  												# we found at least one neighbor which improved the current state
  												a					=next_state
  								else:
  												# since we have no neighbor that improves the solution we stop the search
  												a					=True
  
  				if visualization:
  								from matplotlib import pyplot as plt
  
  								plt.plot(range(lowercase	) ,					lowercase	)
  								plt.xlabel('''Iterations'''	)
  								plt.ylabel('''Function values'''	)
  								plt.show()
  
  				return current_state
  
  
  if __name__ == "__main__":
  							import doctest
  
  							doctest.testmod()
  							def _A		(		lowercase ,					lowercase	):
  
  
  
  
  
  
  
  											"""simple docstring"""
  											return (x**2) + (y**2)
  
  							# starting the problem with initial coordinates (3, 4)
  							lowerCamelCase_     :     List[str]    		=						SearchProblem(x=3, y=4, step_size=1, function_to_optimize=test_fa)
  							lowerCamelCase_     :     Optional[Any]    		=						hill_climbing(prob, find_max=False)
  							print(
  							    """The minimum score for f(x, y) = x^2 + y^2 found via hill climbing: """
  							    F'{local_min.score()}'
  							)
  
  							# starting the problem with initial coordinates (12, 47)
  							lowerCamelCase_     :     str    		=						SearchProblem(x=1_2, y=4_7, step_size=1, function_to_optimize=test_fa)
  							lowerCamelCase_     :     Any    		=						hill_climbing(
  							    prob, find_max=False, max_x=1_0_0, min_x=5, max_y=5_0, min_y=-5, visualization=True
  							)
  							print(
  							    """The minimum score for f(x, y) = x^2 + y^2 with the domain 100 > x > 5 """
  							    F'and 50 > y > - 5 found via hill climbing: {local_min.score()}'
  							)
  							def _A		(		lowercase ,					lowercase	):
  
  
  
  
  
  
  
  											"""simple docstring"""
  											return (3 * x**2) - (6 * y)
  
  							lowerCamelCase_     :     Any    		=						SearchProblem(x=3, y=4, step_size=1, function_to_optimize=test_fa)
  							lowerCamelCase_     :     Tuple    		=						hill_climbing(prob, find_max=True)
  
  
  
  
  
  							print(
  							    """The maximum score for f(x, y) = x^2 + y^2 found via hill climbing: """
  							    F'{local_min.score()}'
  							)
style_context: 
  
  
  """simple docstring"""
  
  
  
  
  
  
  
  from cva import destroyAllWindows, imread, imshow, waitKey
  def _A		(		lowercase ,					lowercase	):
  
  
  
  
  
  
  
      """simple docstring"""
      a	,   a					=img.shape[0], img.shape[1]
  
      def to_grayscale(lowercase ,					lowercase ,					lowercase	):
          return 0.2126 * red + 0.587 * green + 0.114 * blue
  
      def normalize(lowercase	):
          return min(lowercase ,					2_55	)
  
      for i in range(lowercase	):
          for j in range(lowercase	):
              a					=int(to_grayscale(*img[i][j]	)	)
              a					=[
                  normalize(lowercase	),
                  normalize(greyscale + factor	),
                  normalize(greyscale + 2 * factor	),
              ]
  
      return img
  
  
  if __name__ == "__main__":
         # read original image
         lowerCamelCase_     :     Any    		=						{
             percentage: imread("""image_data/lena.jpg""", 1) for percentage in (1_0, 2_0, 3_0, 4_0)
         }
  
         for percentage, img in images.items():
                make_sepia(img, percentage)
  
         for percentage, img in images.items():
                imshow(F'Original image with sepia (factor: {percentage})', img)
  
         waitKey(0)
         destroyAllWindows()