class_docstr: Search commands.
code: def _get_aggregate_result(
      self,
      raw: List,
      query: Union[str, Query, AggregateRequest],
      has_cursor: bool,
  ):
      if has_cursor:
          if isinstance(query, Cursor):
              query.cid = raw[1]
              cursor = query
          else:
              cursor = Cursor(raw[1])
          raw = raw[0]
      else:
          cursor = None
  
      if isinstance(query, AggregateRequest) and query._with_schema:
          schema = raw[0]
          rows = raw[2:]
      else:
          schema = None
          rows = raw[1:]
  
      return AggregateResult(rows, cursor, schema)
  
imports: import itertools
  import time
  from typing import Dict, List, Optional, Union
  from redis.client import Pipeline
  from redis.utils import deprecated_function
  from ..helpers import get_protocol_version, parse_to_dict
  from ._util import to_string
  from .aggregation import AggregateRequest, AggregateResult, Cursor
  from .document import Document
  from .query import Query
  from .result import Result
  from .suggestion import SuggestionParser
label_desc: Use image node_id 27 for calling the SearchCommands obj's underlying member method code with example usage: obj._get_aggregate_result(raw, query, has_cursor) and returns: AggregateResult