input: def order_by_points(nums):
      """
      Write a function that sorts a list of integers in increasing order
      based on the total of their digits. If there are multiple integers with
      the same digit sum, retain their original order from the input list.
  
      For example:
      >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]
      >>> order_by_points([]) == []
      """
output:     return sorted(nums, key=lambda x: (sum(int(d) for d in str(abs(x))), nums.index(x)))