input: Write a function to create an AI-powered Python script that optimizes any given code. The function should take a function and its parameters as input, optimize the parameters, and return the optimized parameters. The function should also be able to handle a dataclass for the parameters.
  
  from dataclasses import dataclass
  
  @dataclass
  class Params:
   a: int
   b: int
   c: int
  
  def get_result(params: Params) -> int:
   return params.a + params.b + params.c
  
  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
  
  if __name__ == '__main__':
   params = Params(a=1, b=2, c=3)
   best_params = optimize(get_result, params)
   print("Optimized result: %d" % get_result(Params(best_params['a'], best_params['b'], best_params['c'])))
  
  assert optimize(get_result, Params(a=1, b=2, c=3)) == {'a': 1, 'b': 2, 'c': 3}
  assert optimize(get_result, Params(a=10, b=20, c=30)) == {'a': 20, 'b': 30, 'c': 40}
  assert optimize(get_result, Params(a=-5, b=-10, c=-15)) == {'a': -5, 'b': -10, 'c': -15}
  assert optimize(get_result, Params(a=0, b=0, c=0)) == {'a': 0, 'b': 0, 'c': 0}
  assert optimize(get_result, Params(a=-10, b=10, c=0)) == {'a': -10, 'b': 10, 'c': 0}
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