input: Write a function to implement the Gradient Descent algorithm for linear regression in Python. The function should take input features (x), target values (y), a learning rate (default to 0.01), and the number of iterations (default to 100). The function should return the final computed slope (m) and intercept (b) after performing the gradient descent iterations.
  assert gradient_descent(np.array([1, 2, 3, 4]), np.array([10, 20, 30, 40]), 0.01, 100) == (10.0, 0.0)
  assert gradient_descent(np.array([1, 2, 3, 4]), np.array([5, 10, 15, 20]), 0.01, 100) == (5.0, 0.0)
  assert gradient_descent(np.array([1, 1, 1, 1]), np.array([2, 2, 2, 2]), 0.01, 100) == (0.0, 2.0)
  assert gradient_descent(np.array([1]), np.array([2]), 0.01, 100) == (100.0, 0.0)
  assert gradient_descent(np.array([]), np.array([]), 0.01, 100) == (0.0, 0.0)
output: def gradient_descent(x, y, learning_rate=0.01, num_iterations=100):
      m, b = 0.0, 0.0
      n = len(x)
      if n == 0:
          return m, b
      for _ in range(num_iterations):
          y_pred = m * x + b
          dm = (-2/n) * sum(x * (y - y_pred))
          db = (-2/n) * sum(y - y_pred)
          m -= learning_rate * dm
          b -= learning_rate * db
      return m, b