code: def consumer_initialize_task(processor, consumer_client, shard_id, cursor_position, cursor_start_time, cursor_end_time=None):
      
      try:
          processor.initialize(shard_id)
          is_cursor_persistent = False
          check_point = consumer_client.get_check_point(shard_id)
          if check_point['checkpoint'] and len(check_point['checkpoint']) > 0:
              is_cursor_persistent = True
              cursor = check_point['checkpoint']
          else:
              if cursor_position == CursorPosition.BEGIN_CURSOR:
                  cursor = consumer_client.get_begin_cursor(shard_id)
              elif cursor_position == CursorPosition.END_CURSOR:
                  cursor = consumer_client.get_end_cursor(shard_id)
              else:
                  cursor = consumer_client.get_cursor(shard_id, cursor_start_time)
  
          end_cursor = None
          if cursor_end_time is not None:
              end_cursor = consumer_client.get_cursor(shard_id, cursor_end_time)
  
          return InitTaskResult(cursor, is_cursor_persistent, end_cursor)
      except Exception as e:
          return TaskResult(e)
docs: return TaskResult if failed, or else, return InitTaskResult
      :param processor:
      :param consumer_client:
      :param shard_id:
      :param cursor_position:
      :param cursor_start_time:
      :return: