input: Write a python function to calculate the total time in minutes from a string representation.
  assert calculate_total_time("3 hours, 4 minutes") == 184
  assert calculate_total_time("1 hour, 30 minutes") == 90
  assert calculate_total_time("2 hours") == 120
  assert calculate_total_time("45 minutes") == 45
output: def calculate_total_time(time_str):
      total_minutes = 0
      if "hour" in time_str:
          hours = int(time_str.split("hour")[0].strip())
          total_minutes += hours * 60
          time_str = time_str.split("hour")[1].strip()
      if "minute" in time_str:
          minutes = int(time_str.split("minute")[0].strip())
          total_minutes += minutes
      return total_minutes