input: Write a function to optimize any given code using an AI-powered Python script. The function should accept a function and its parameters, and return the optimized parameters that yield the best score. Also, provide test cases to demonstrate the function's usage.
  
  def optimize(fn, params):
   best_score = 0
   best_params = None
   for a in range(params.a - 10, params.a + 10):
   for b in range(params.b - 10, params.b + 10):
   for c in range(params.c - 10, params.c + 10):
   score = fn(Params(a, b , c))
   if score > best_score:
   best_score = score
   best_params = {
   'a': a,
   'b': b,
   'c': c
   }
   return best_params
  
  from dataclasses import dataclass
  
  @dataclass
  class Params:
   a: int
   b: int
   c: int
  
  def get_result(params: Params) -> int:
   """Returns the sum of the three given numbers"""
   return params.a + params.b + params.c
  
  assert optimize(get_result, Params(a=1, b=2, c=3))['a'] == 1
  assert optimize(get_result, Params(a=1, b=2, c=3))['b'] == 2
  assert optimize(get_result, Params(a=1, b=2, c=3))['c'] == 3
  assert optimize(get_result, Params(a=5, b=10, c=15))['a'] == 5
  assert optimize(get_result, Params(a=5, b=10, c=15))['b'] == 10
  assert optimize(get_result, Params(a=5, b=10, c=15))['c'] == 15
output: def optimize(fn, params):
      best_score = 0
      best_params = None
      for a in range(params.a - 10, params.a + 10):
          for b in range(params.b - 10, params.b + 10):
              for c in range(params.c - 10, params.c + 10):
                  score = fn(Params(a, b, c))
                  if score > best_score:
                      best_score = score
                      best_params = {
                          'a': a,
                          'b': b,
                          'c': c
                      }
      return best_params