code: def _get_rel_list(parsed_sentence):
      res = []
      gen_toks = []
      for tok in parsed_sentence:
          gen_toks.append(
              DepRelationTerm(
                  tok.get("text"),
                  tok.get("lemma"),
                  tok.get("pos"),
                  tok.get("ner"),
                  tok.get("start"),
              )
          )
  
      for gen_tok, tok in zip(gen_toks, parsed_sentence):
          gov_idx = tok["gov"]
          if gov_idx != -1:
              res.append(
                  DepRelation(gen_toks[gov_idx], gen_tok, tok["rel"])
              )
      return res
  
imports: import copy
  import re
  import sys
  from os import PathLike
  from tqdm import tqdm
  from nlp_architect.models.absa import TRAIN_LEXICONS, LEXICONS_OUT
  from nlp_architect.models.absa import GENERIC_OP_LEX
  from nlp_architect.models.absa.inference.data_types import Polarity
  from nlp_architect.models.absa.train.data_types import AspectTerm, DepRelation, DepRelationTerm, LoadOpinionStopLists, LoadAspectStopLists, OpinionTerm, QualifiedTerm
  from nlp_architect.models.absa.train.rules import rule_1, rule_2, rule_3, rule_4, rule_5, rule_6
  from nlp_architect.models.absa.utils import _load_parsed_docs_from_dir, _write_final_opinion_lex, _load_lex_as_list_from_csv, read_generic_lex_from_file
label_desc: Use image node_id 2 for calling a global function with example usage: _get_rel_list(parsed_sentence) and returns: res