input: Write a function to identify and fix any bugs in the provided Python code. If the given code is empty, return the code without any modifications.
  def sum_list(list):
      sum_list = 0
      for num in list:
          sum_list += num
      return sum
  
  assert sum_list([1, 2, 3, 4])==10
  assert sum_list([-1, -2, -3, -4])==-10
  assert sum_list([])==0
  assert sum_list([5])==5
  assert sum_list([1, 2, 3, 4, 5])==15
output: def sum_list(list):
      sum_list = 0
      for num in list:
          sum_list += num
      return sum_list