code: def guess_task_type(name, task_defn):
      
      parts = name.split(':')
      task_type = parts[-1]
      if task_type == 'parent':
          if is_action(task_defn):
              task_type = 'action'
          else:
              task_type = 'decision'
      if task_type not in get_valid_task_types():
          raise CoTError(
              "Invalid task type for {}!".format(name)
          )
      return task_type
docs: Guess the task type of the task.
  
      Args:
          name (str): the name of the task.
  
      Returns:
          str: the task_type.
  
      Raises:
          CoTError: on invalid task_type.