input: def sort_by_digit_sum(nums):
      """
      Write a function to sort a list of integers in ascending order based on the sum of their digits.
      In cases where the digit sum is the same, retain their original order from the list.
  
      For instance:
      >>> sort_by_digit_sum([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]
      >>> sort_by_digit_sum([]) == []
      """
output:     
      return sorted(nums, key=lambda x: (sum(int(d) for d in str(abs(x))), nums.index(x)))
  