code: def _consolidate_aspects(aspect_row, sentence):
      """Returns consolidated indices of aspect terms in sentence.
  
      Args:
          aspect_row: List of aspect terms which belong to the same aspect-group.
      """
      indices = []
      aspect_phrases: list = sorted(
          [phrase.split(" ") for phrase in aspect_row],
          key=len,
          reverse=True,
      )
      appeared = set()
      for tok_i in range(len(sentence)):
          for aspect_phrase in aspect_phrases:
              if _sentence_contains_after(
                  sentence, tok_i, aspect_phrase
              ):
                  span = range(tok_i, tok_i + len(aspect_phrase))
                  if not appeared & set(span):
                      appeared |= set(span)
                      indices.append(list(span))
      return indices
  
imports: import math
  from os import PathLike
  from pathlib import Path, PosixPath
  from typing import Union
  from nlp_architect.common.core_nlp_doc import CoreNLPDoc
  from nlp_architect.models.absa import INFERENCE_OUT
  from nlp_architect.models.absa.inference.data_types import Term, TermType, Polarity, SentimentDoc, SentimentSentence, LexiconElement
  from nlp_architect.models.absa.utils import _read_lexicon_from_csv, load_opinion_lex, _load_aspect_lexicon, parse_docs, parse_docs_bist, _load_parsed_docs_from_dir
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: _consolidate_aspects(aspect_row, sentence) and returns: indices