input: Write a function that takes a number as input and calculates the sum of its digits. The function should handle both integer and string representations of the number.
  assert calculate_sum_of_digits(6342) == 15
  assert calculate_sum_of_digits("6342") == 15
  assert calculate_sum_of_digits(0) == 0
  assert calculate_sum_of_digits(-123) == 6
  assert calculate_sum_of_digits("0") == 0
output: def calculate_sum_of_digits(num):
      if isinstance(num, int):
          num = str(abs(num))
      return sum(int(digit) for digit in num)