code: def merge_schema(schema_list: List[RecordSchema]):
      type_set = set()
      role_set = set()
      type_role_dict = defaultdict(list)
  
      for schema in schema_list:
          for type_name in schema.type_list:
              type_set.add(type_name)
  
          for role_name in schema.role_list:
              role_set.add(role_name)
  
          for type_name in schema.type_role_dict:
              type_role_dict[type_name] += schema.type_role_dict[
                  type_name
              ]
  
      for type_name in type_role_dict:
          type_role_dict[type_name] = list(
              set(type_role_dict[type_name])
          )
  
      return RecordSchema(
          type_list=list(type_set),
          role_list=list(role_set),
          type_role_dict=type_role_dict,
      )
  
file_path: DeepKE/src/deepke/name_entity_re/cross/extraction/record_schema.py
imports: import json
  from collections import defaultdict
  from typing import List
label_desc: Use image node_id 1 for calling a global function with example usage: merge_schema(schema_list) and returns: RecordSchema