code: def _handle_relation_data(relation_data: List[Dict]) -> Dict:
      rels = OrderedDict()
      relation_data = sorted(
          relation_data, key=lambda i: int(i["index"])
      )
      for d in relation_data:
          rels[d["relation"]] = {
              "index": int(d["index"]),
              "head_type": d["head_type"],
              "tail_type": d["tail_type"],
          }
  
      return rels
  
file_path: DeepKE/example/triple/cnschema/preprocess.py
imports: import os
  import logging
  from collections import OrderedDict
  from typing import List, Dict
  from transformers import BertTokenizer
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: _handle_relation_data(relation_data) and returns: rels